You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2003/03/20 16:56:21 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardPipeline.java

costin      2003/03/20 07:56:21

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardPipeline.java
  Log:
  Added a method that will allow us to see what valves are associated with each
  container.
  ( pipeline is a helper for container - it won't be exposed directly )
  
  Revision  Changes    Path
  1.3       +27 -10    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardPipeline.java
  
  Index: StandardPipeline.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardPipeline.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StandardPipeline.java	25 Nov 2002 21:03:50 -0000	1.2
  +++ StandardPipeline.java	20 Mar 2003 15:56:21 -0000	1.3
  @@ -67,6 +67,8 @@
   
   import java.io.IOException;
   import javax.servlet.ServletException;
  +import javax.management.ObjectName;
  +import javax.management.MalformedObjectNameException;
   import org.apache.catalina.Contained;
   import org.apache.catalina.Container;
   import org.apache.catalina.Lifecycle;
  @@ -79,8 +81,12 @@
   import org.apache.catalina.Response;
   import org.apache.catalina.Valve;
   import org.apache.catalina.ValveContext;
  +import org.apache.catalina.valves.ValveBase;
   import org.apache.catalina.util.LifecycleSupport;
   import org.apache.catalina.util.StringManager;
  +import org.apache.commons.modeler.Registry;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   
   
   /**
  @@ -97,8 +103,11 @@
    */
   
   public class StandardPipeline
  -    implements Pipeline, Contained, Lifecycle {
  +    implements Pipeline, Contained, Lifecycle 
  + {
  +    private static Log log = LogFactory.getLog(StandardPipeline.class);
   
  +   
   
       // ----------------------------------------------------------- Constructors
   
  @@ -255,7 +264,6 @@
   
       }
   
  -
       /**
        * Prepare for active use of the public methods of this Component.
        *
  @@ -364,7 +372,7 @@
                   try {
                       ((Lifecycle) oldBasic).stop();
                   } catch (LifecycleException e) {
  -                    log("StandardPipeline.setBasic: stop", e);
  +                    log.error("StandardPipeline.setBasic: stop", e);
                   }
               }
               if (oldBasic instanceof Contained) {
  @@ -386,7 +394,7 @@
               try {
                   ((Lifecycle) valve).start();
               } catch (LifecycleException e) {
  -                log("StandardPipeline.setBasic: start", e);
  +                log.error("StandardPipeline.setBasic: start", e);
                   return;
               }
           }
  @@ -425,7 +433,7 @@
               try {
                   ((Lifecycle) valve).start();
               } catch (LifecycleException e) {
  -                log("StandardPipeline.addValve: start: ", e);
  +                log.error("StandardPipeline.addValve: start: ", e);
               }
           }
   
  @@ -458,6 +466,16 @@
   
       }
   
  +    public ObjectName[] getValveNames() {
  +        ObjectName oname[]=new ObjectName[valves.length + 1];
  +        for( int i=0; i<valves.length; i++ ) {
  +            if( valves[i] instanceof ValveBase )
  +                oname[i]=((ValveBase)valves[i]).getObjectName();
  +        }
  +        if( basic instanceof ValveBase )
  +            oname[valves.length]=((ValveBase)basic).getObjectName();
  +        return oname;
  +    }
   
       /**
        * Cause the specified request and response to be processed by the Valves
  @@ -538,7 +556,7 @@
               try {
                   ((Lifecycle) valve).stop();
               } catch (LifecycleException e) {
  -                log("StandardPipeline.removeValve: stop: ", e);
  +                log.error("StandardPipeline.removeValve: stop: ", e);
               }
           }
   
  @@ -589,6 +607,5 @@
           }
   
       }
  -
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org