Examples of BaseInterceptor


Examples of org.apache.tomcat.core.BaseInterceptor

        }
    }

    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

Examples of org.apache.tomcat.core.BaseInterceptor

    /** 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

Examples of org.apache.tomcat.core.BaseInterceptor

  }
    }

    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

Examples of org.apache.tomcat.core.BaseInterceptor

     @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

Examples of org.apache.tomcat.core.BaseInterceptor

    /** 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

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();

        // 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

Examples of org.apache.tomcat.core.BaseInterceptor

        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

Examples of org.apache.tomcat.core.BaseInterceptor

  }

 
  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

Examples of org.apache.tomcat.core.BaseInterceptor

            Vector ctxModules=new Vector();
            allModules.put( context, ctxModules );

      // Now add all modules to cm
      for( int i=0; i< modV.size(); i++ ) {
    BaseInterceptor bi=(BaseInterceptor)modV.elementAt( i );
    if(debug>0) log( "Add dummy module, for configuration " + context.getDocBase() + " " + context);
    cm.addInterceptor( bi );
                ctxModules.addElement( bi );
      }
      cm.setNote"trustedLoader.currentContext", null );
View Full Code Here

Examples of org.apache.tomcat.core.BaseInterceptor

        Vector ctxModules = (Vector)allModules.get( ctx );
        if( ctxModules != null ) {
            // remove modules
            for( int i=0; i< ctxModules.size(); i++ ) {
                BaseInterceptor bi=(BaseInterceptor)ctxModules.elementAt( i );
                cm.removeInterceptor( bi );
            }
            ctxModules.removeAllElements();
        } else {
            ctxModules = new Vector();
            allModules.put( ctx, ctxModules );
        }

  // The real loader is set.
  Vector modV=new Vector();
  if( debug > 0 ) log( "Loading the real module " + ctx + " " + modules);
  loadInterceptors( ctx, modules, modV );
  cm.setNote( "trustedLoader.currentContext", ctx );

  // Now add all modules to cm
  for( int i=0; i< modV.size(); i++ ) {
      BaseInterceptor bi=(BaseInterceptor)modV.elementAt( i );
      cm.addInterceptor( bi );
            ctxModules.addElement( bi );
  }
  cm.setNote"trustedLoader.currentContext", null );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.