Package org.apache.tomcat.core

Examples of org.apache.tomcat.core.BaseInterceptor


      ctx1.setTrusted( ctx.isTrusted());
      e=ctx.getHostAliases();
      while( e.hasMoreElements())
    ctx1.addHostAlias( (String)e.nextElement());
     
      BaseInterceptor ri[] =
    cm.getContainer().getInterceptors(Container.H_copyContext);
      int i;
      for( i=0; i < ri.length; i++) {
    ri[i].copyContext(request, ctx, ctx1);
      }
      cm.removeContext( ctx );
       
      cm.addContext( ctx1 );
     
      // put back saved local interceptors
      e=sI.elements();
      while(e.hasMoreElements()){
    BaseInterceptor savedI=(BaseInterceptor)e.nextElement();
   
    ctx1.addInterceptor(savedI);
    savedI.setContext(ctx1);
    savedI.reload(request,ctx1);
      }

      ctx1.init();
  }
    }
View Full Code Here


    throw new JspException( "Can't find context manager" );

      Context ctx=(Context)pageContext.getAttribute("ctx");

      Container ct=(ctx==null)? cm.getContainer():ctx.getContainer();
      BaseInterceptor bi[]=ct.getInterceptors();
      BaseInterceptor found=null;
      for( int i=0; i<bi.length; i++ ) {
    String cn=bi[i].getClass().getName();
    if( cn.equals( moduleName )) {
        found=bi[i];
        pageContext.setAttribute( var,bi[i],
View Full Code Here

        }
    }

    protected void initWorker(ContextManager cm) {
  // Find Ajp1? connectors
  BaseInterceptor ci[]=cm.getContainer().getInterceptors();
     
  for( int i=0; i<ci.length; i++ ) {
      Object con=ci[i];
      // if jkWorker not specified and Ajp13 Interceptor found, use Ajp13
      if( jkWorker == null && (con instanceof Ajp13Interceptor) ) {
View Full Code Here

    /** Re-map the request as an internal redirect.
     *  We have gray areas in the 2.2 spec, so we are going to follow
     *  the 2.3 spec for guidance.
     */
    private int doInternalRedirect(Request req, String welcomeFile) {
        BaseInterceptor ri[];
  String requestURI=req.requestURI().toString();
  String redirectURI=concatPath(requestURI,welcomeFile);
  Context ctx = req.getContext();
  req.requestURI().setString(redirectURI);
  req.unparsedURI().recycle();
View Full Code Here

  }
    }

    private String getStrictWelcomeFile(Context context, File dir, String pathInfo) {
        String wf[]= context.getWelcomeFiles();
        BaseInterceptor ri[] = context.getContainer().
                            getInterceptors(Container.H_contextMap);
  for(int i=0; i < wf.length; i++) {
      if(getOneWelcomeFile(dir, wf[i])) {
    return wf[i];
      }
View Full Code Here

     @see addModule( BaseInterceptor ri )
     */
    public int addModule( String className )
  throws TomcatException
    {
  BaseInterceptor bi=createModule( className );
  if( bi==null )
      throw new TomcatException("module not found " + className);
  return addModule( bi );
    }
View Full Code Here

    /** Find the session, set session id, source, mark it as accessed.
     */
    private ServerSession processSession(Request request,
           String sessionId, String source )
    {
  BaseInterceptor reqI[]= request.getContainer().
      getInterceptors(Container.H_findSession);
 
  ServerSession sess=null;
  for( int i=0; i< reqI.length; i++ ) {
      sess=reqI[i].findSession( request,
View Full Code Here

        ctx1.setTrusted( ctx.isTrusted());
        e=ctx.getHostAliases();
        while( e.hasMoreElements())
      ctx1.addHostAlias( (String)e.nextElement());

        BaseInterceptor ri[] =
      cm.getContainer().getInterceptors(Container.H_copyContext);
        int i;
        for( i=0; i < ri.length; i++) {
      ri[i].copyContext(request, ctx, ctx1);
        }
        cm.removeContext( ctx );
       
        cm.addContext( ctx1 );

        // put back saved local interceptors
        e=sI.elements();
        while(e.hasMoreElements()){
      BaseInterceptor savedI=(BaseInterceptor)e.nextElement();
     
      ctx1.addInterceptor(savedI);
      savedI.setContext(ctx1);
      savedI.reload(request,ctx1);
        }

        ctx1.init();

        // remap the request
        request.setAttribute("tomcat.ReloadInterceptor", this);
        ri = cm.getContainer().getInterceptors(Container.H_contextMap);
       
        for( i=0; i< ri.length; i++ ) {
      if( ri[i]==this ) break;
      int status=ri[i].contextMap( request );
      if( status!=0 ) return status;
        }
    }
       
      } else {
    // This is the old ( buggy) behavior
    // ctx.reload() has some fixes - it removes most of the
    // user servlets, but still need work XXX.

    // we also need to save context attributes.

    Enumeration sE=ctx.getServletNames();
    while( sE.hasMoreElements() ) {
        try {
      String sN=(String)sE.nextElement();
      Handler sw=ctx.getServletByName( sN );
      sw.reload();
        } catch( Exception ex ) {
      log( "Reload exception: " + ex);
        }
    }

    // send notification to all interceptors
    // They may try to save up the state or take
    // the right actions


    if( debug>0 ) log( "Reloading hooks for context " +
           ctx.toString());

    // Call reload hook in context manager
    BaseInterceptor cI[]=ctx.getContainer().getInterceptors();
    for( int i=0; i< cI.length; i++ ) {
        cI[i].reloadrequest, ctx );
        ctx.getContainer().setNote( "oldLoader", null);
    }
      }
View Full Code Here

        pw.println("ApJServLogLevel notice");
        pw.println();

        // Find Ajp12 connector
        int portInt=8007;
        BaseInterceptor ci[]=cm.getContainer().getInterceptors();
        for( int i=0; i<ci.length; i++ ) {
            Object con=ci[i];
            if( con instanceof  Ajp12Interceptor ) {
                Ajp12Interceptor tcpCon=(Ajp12Interceptor) con;
                portInt=tcpCon.getPort();
View Full Code Here

  }

 
  Enumeration en=p.getModules();
  while( en.hasMoreElements()) {
      BaseInterceptor bi=(BaseInterceptor)en.nextElement();
      if( debug > 0 ) log( ctx + " " + bi );
      ctx.addInterceptor( bi );
  }
    }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.core.BaseInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.