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

2005-05-08 Thread billbarker
billbarker2005/05/08 15:16:47

  Modified:catalina/src/share/org/apache/catalina/core
StandardPipeline.java
  Log:
  Fix problem where the "first" Valve wasn't removed from the Pipeline.
  
  Of course, this can only happen when running Tomcat as Embedded, or with 
advanced JMX management scenarios.
  
  Fix for Bug #34546
  Reported By:   Christian Betz <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.23  +7 -1  
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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- StandardPipeline.java 23 Jun 2004 16:59:41 -  1.22
  +++ StandardPipeline.java 8 May 2005 22:16:47 -   1.23
  @@ -515,7 +515,13 @@
*/
   public void removeValve(Valve valve) {
   
  -Valve current = first;
  +Valve current;
  +if(first == valve) {
  +first = first.getNext();
  +current = null;
  +} else {
  +current = first;
  +}
   while (current != null) {
   if (current.getNext() == valve) {
   current.setNext(valve.getNext());
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-11-13 Thread remm
remm2003/11/13 00:29:33

  Modified:catalina/src/share/org/apache/catalina/core
StandardPipeline.java
  Log:
  - Fix unregistration of valves on stop (the objectname should be reset so that
the valve is registered again).
  
  Revision  ChangesPath
  1.17  +4 -3  
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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- StandardPipeline.java 8 Sep 2003 15:57:21 -   1.16
  +++ StandardPipeline.java 13 Nov 2003 08:29:33 -  1.17
  @@ -377,6 +377,7 @@
   
   ObjectName vname=vb.getObjectName();
   Registry.getRegistry().getMBeanServer().unregisterMBean(vname);
  +((ValveBase)valve).setObjectName(null);
   }
   } catch( Throwable t ) {
   log.info( "Can't unregister valve " + valve , t );
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-09-08 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:

jfarcand2003/09/08 08:57:21

  Modified:catalina/src/share/org/apache/catalina/core
StandardPipeline.java
  Log:
  Allow extention fo this class (The SecurityManager will block any malicious uses at 
runtime)
-0.5.
I believe extending this violates the design of the Catalina container 
(it is the reason why I made that final; this wasn't for security 
reasons). Can you justify the need with a use case ?

Remy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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

2003-09-08 Thread jfarcand
jfarcand2003/09/08 08:57:21

  Modified:catalina/src/share/org/apache/catalina/core
StandardPipeline.java
  Log:
  Allow extention fo this class (The SecurityManager will block any malicious uses at 
runtime)
  
  Revision  ChangesPath
  1.16  +5 -5  
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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- StandardPipeline.java 2 Sep 2003 21:22:04 -   1.15
  +++ StandardPipeline.java 8 Sep 2003 15:57:21 -   1.16
  @@ -101,7 +101,7 @@
* @author Craig R. McClanahan
*/
   
  -public final class StandardPipeline
  +public class StandardPipeline
   implements Pipeline, Contained, Lifecycle 
{
   private static Log log = LogFactory.getLog(StandardPipeline.class);
  @@ -546,7 +546,7 @@
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet exception is thrown
*/
  -public final void invoke(Request request, Response response)
  +public void invoke(Request request, Response response)
   throws IOException, ServletException {
   
   // Invoke the first Valve in this pipeline for this request
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-07-23 Thread remm
remm2003/07/23 06:31:59

  Modified:catalina/src/share/org/apache/catalina/core
StandardPipeline.java
  Log:
  - Valves should only be registered and unregistered when:
- addValve or removeValve is called and the associated pipeline is started
- on start and stop of the pipeline
  - This fixes bug 21822.
  
  Revision  ChangesPath
  1.13  +21 -17
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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StandardPipeline.java 26 May 2003 22:03:59 -  1.12
  +++ StandardPipeline.java 23 Jul 2003 13:31:59 -  1.13
  @@ -481,15 +481,17 @@
   ((Contained) valve).setContainer(this.container);
   
   // Start the new component if necessary
  -if (started && (valve instanceof Lifecycle)) {
  -try {
  -((Lifecycle) valve).start();
  -} catch (LifecycleException e) {
  -log.error("StandardPipeline.addValve: start: ", e);
  +if (started) {
  +if (valve instanceof Lifecycle) {
  +try {
  +((Lifecycle) valve).start();
  +} catch (LifecycleException e) {
  +log.error("StandardPipeline.addValve: start: ", e);
  +}
   }
  +// Register the newly added valve
  +registerValve(valve);
   }
  -// Register the newly added valve
  -registerValve(valve);
   
   // Add this Valve to the set associated with this Pipeline
   synchronized (valves) {
  @@ -606,15 +608,17 @@
   }
   
   // Stop this valve if necessary
  -if (started && (valve instanceof Lifecycle)) {
  -try {
  -((Lifecycle) valve).stop();
  -} catch (LifecycleException e) {
  -log.error("StandardPipeline.removeValve: stop: ", e);
  +if (started) {
  +if (valve instanceof Lifecycle) {
  +try {
  +((Lifecycle) valve).stop();
  +} catch (LifecycleException e) {
  +log.error("StandardPipeline.removeValve: stop: ", e);
  +}
   }
  +// Unregister the removed valave
  +unregisterValve(valve);
   }
  -// Unregister the removed valave
  -unregisterValve(valve);
   
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-03-28 Thread Amy Roh
> remm2003/03/28 06:58:08
>
>   Modified:catalina/src/share/org/apache/catalina/core
> StandardPipeline.java
>   Log:
>   - Valves registration should only happen on start/stop, otherwise, the
container
> hierarchy may not be initialized.

Does this mean valves can't be added without stoping the container which
will have to remove dynamic valve creation/addition feature in admin?

Amy

>
>   Revision  ChangesPath
>   1.7   +7 -7
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/Standard
Pipeline.java
>
>   Index: StandardPipeline.java
>   ===
>   RCS file:
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/cor
e/StandardPipeline.java,v
>   retrieving revision 1.6
>   retrieving revision 1.7
>   diff -u -r1.6 -r1.7
>   --- StandardPipeline.java 27 Mar 2003 03:06:39 - 1.6
>   +++ StandardPipeline.java 28 Mar 2003 14:58:08 - 1.7
>   @@ -477,6 +477,8 @@
>} catch (LifecycleException e) {
>log.error("StandardPipeline.addValve: start: ", e);
>}
>   +// Register the newly added valve
>   +registerValve(valve);
>}
>
>// Add this Valve to the set associated with this Pipeline
>   @@ -486,8 +488,6 @@
>results[valves.length] = valve;
>valves = results;
>}
>   -// register the newly added valve
>   -registerValve(valve);
>
>}
>
>   @@ -602,9 +602,9 @@
>} catch (LifecycleException e) {
>log.error("StandardPipeline.removeValve: stop: ", e);
>}
>   +// Unregister the removed valave
>   +unregisterValve(valve);
>}
>   -// unregister the removed valave
>   -unregisterValve(valve);
>
>}
>
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-03-28 Thread remm
remm2003/03/28 06:58:08

  Modified:catalina/src/share/org/apache/catalina/core
StandardPipeline.java
  Log:
  - Valves registration should only happen on start/stop, otherwise, the container
hierarchy may not be initialized.
  
  Revision  ChangesPath
  1.7   +7 -7  
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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StandardPipeline.java 27 Mar 2003 03:06:39 -  1.6
  +++ StandardPipeline.java 28 Mar 2003 14:58:08 -  1.7
  @@ -477,6 +477,8 @@
   } catch (LifecycleException e) {
   log.error("StandardPipeline.addValve: start: ", e);
   }
  +// Register the newly added valve
  +registerValve(valve);
   }
   
   // Add this Valve to the set associated with this Pipeline
  @@ -486,8 +488,6 @@
   results[valves.length] = valve;
   valves = results;
   }
  -// register the newly added valve
  -registerValve(valve);
   
   }
   
  @@ -602,9 +602,9 @@
   } catch (LifecycleException e) {
   log.error("StandardPipeline.removeValve: stop: ", e);
   }
  +// Unregister the removed valave
  +unregisterValve(valve);
   }
  -// unregister the removed valave
  -unregisterValve(valve);
   
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-03-20 Thread costin
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  ChangesPath
  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 -  1.2
  +++ StandardPipeline.java 20 Mar 2003 15:56:21 -  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