You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/02/11 21:37:15 UTC

svn commit: r1729888 - /tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java

Author: markt
Date: Thu Feb 11 20:37:15 2016
New Revision: 1729888

URL: http://svn.apache.org/viewvc?rev=1729888&view=rev
Log:
Clean-up

Modified:
    tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java?rev=1729888&r1=1729887&r2=1729888&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java Thu Feb 11 20:37:15 2016
@@ -16,18 +16,12 @@
  */
 package org.apache.catalina.valves;
 
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-
 import org.apache.catalina.Contained;
 import org.apache.catalina.Container;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Pipeline;
 import org.apache.catalina.Valve;
-import org.apache.catalina.connector.Request;
-import org.apache.catalina.connector.Response;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.res.StringManager;
@@ -41,8 +35,10 @@ import org.apache.tomcat.util.res.String
  *
  * @author Craig R. McClanahan
  */
-public abstract class ValveBase extends LifecycleMBeanBase
-    implements Contained, Valve {
+public abstract class ValveBase extends LifecycleMBeanBase implements Contained, Valve {
+
+    protected static StringManager sm = StringManager.getManager(ValveBase.class);
+
 
     //------------------------------------------------------ Constructor
 
@@ -50,16 +46,20 @@ public abstract class ValveBase extends
         this(false);
     }
 
+
     public ValveBase(boolean asyncSupported) {
         this.asyncSupported = asyncSupported;
     }
 
+
     //------------------------------------------------------ Instance Variables
+
     /**
      * Does this valve support Servlet 3+ async requests?
      */
     protected boolean asyncSupported;
 
+
     /**
      * The Container whose pipeline this Valve is a component of.
      */
@@ -78,24 +78,25 @@ public abstract class ValveBase extends
     protected Valve next = null;
 
 
-    /**
-     * The string manager for this package.
-     */
-    protected static final StringManager sm =
-        StringManager.getManager(Constants.Package);
-
-
     //-------------------------------------------------------------- Properties
 
-
     /**
      * Return the Container with which this Valve is associated, if any.
      */
     @Override
     public Container getContainer() {
+        return container;
+    }
 
-        return (container);
 
+    /**
+     * Set the Container with which this Valve is associated, if any.
+     *
+     * @param container The new associated container
+     */
+    @Override
+    public void setContainer(Container container) {
+        this.container = container;
     }
 
 
@@ -111,27 +112,12 @@ public abstract class ValveBase extends
 
 
     /**
-     * Set the Container with which this Valve is associated, if any.
-     *
-     * @param container The new associated container
-     */
-    @Override
-    public void setContainer(Container container) {
-
-        this.container = container;
-
-    }
-
-
-    /**
      * Return the next Valve in this pipeline, or <code>null</code> if this
      * is the last Valve in the pipeline.
      */
     @Override
     public Valve getNext() {
-
-        return (next);
-
+        return next;
     }
 
 
@@ -142,15 +128,12 @@ public abstract class ValveBase extends
      */
     @Override
     public void setNext(Valve valve) {
-
         this.next = valve;
-
     }
 
 
     //---------------------------------------------------------- Public Methods
 
-
     /**
      * Execute a periodic task, such as reloading, etc. This method will be
      * invoked inside the classloading context of this container. Unexpected
@@ -162,27 +145,9 @@ public abstract class ValveBase extends
     }
 
 
-    /**
-     * The implementation-specific logic represented by this Valve.  See the
-     * Valve description for the normal design patterns for this method.
-     * <p>
-     * This method <strong>MUST</strong> be provided by a subclass.
-     *
-     * @param request The servlet request to be processed
-     * @param response The servlet response to be created
-     *
-     * @exception IOException if an input/output error occurs
-     * @exception ServletException if a servlet error occurs
-     */
-    @Override
-    public abstract void invoke(Request request, Response response)
-        throws IOException, ServletException;
-
-
     @Override
     protected void initInternal() throws LifecycleException {
         super.initInternal();
-
         containerLog = getContainer().getLogger();
     }
 
@@ -196,7 +161,6 @@ public abstract class ValveBase extends
      */
     @Override
     protected synchronized void startInternal() throws LifecycleException {
-
         setState(LifecycleState.STARTING);
     }
 
@@ -210,7 +174,6 @@ public abstract class ValveBase extends
      */
     @Override
     protected synchronized void stopInternal() throws LifecycleException {
-
         setState(LifecycleState.STOPPING);
     }
 
@@ -233,6 +196,7 @@ public abstract class ValveBase extends
 
 
     // -------------------- JMX and Registration  --------------------
+
     @Override
     public String getObjectNameKeyProperties() {
         StringBuilder name = new StringBuilder("type=Valve");
@@ -279,6 +243,7 @@ public abstract class ValveBase extends
         return name.toString();
     }
 
+
     @Override
     public String getDomainInternal() {
         Container c = getContainer();



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