Author: markt
Date: Fri Nov 25 09:00:14 2016
New Revision: 1771257

URL: http://svn.apache.org/viewvc?rev=1771257&view=rev
Log:
Refactor Catalina interfaces to make wider use of the Contained interface and 
reduce duplication.

Modified:
    tomcat/trunk/java/org/apache/catalina/Cluster.java
    tomcat/trunk/java/org/apache/catalina/Pipeline.java
    tomcat/trunk/java/org/apache/catalina/Realm.java
    tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/Cluster.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Cluster.java?rev=1771257&r1=1771256&r2=1771257&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Cluster.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Cluster.java Fri Nov 25 09:00:14 2016
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.catalina;
 
 /**
@@ -29,9 +28,7 @@ package org.apache.catalina;
  * @author Bip Thelin
  * @author Remy Maucherat
  */
-public interface Cluster {
-
-    // ------------------------------------------------------------- Properties
+public interface Cluster extends Contained {
 
     /**
      * Return the name of the cluster that this Server is currently
@@ -41,6 +38,7 @@ public interface Cluster {
      */
     public String getClusterName();
 
+
     /**
      * Set the name of the cluster to join, if no cluster with
      * this name is present create one.
@@ -49,22 +47,6 @@ public interface Cluster {
      */
     public void setClusterName(String clusterName);
 
-    /**
-     * Set the Container associated with our Cluster
-     *
-     * @param container The Container to use
-     */
-    public void setContainer(Container container);
-
-    /**
-     * Get the Container associated with our Cluster
-     *
-     * @return The Container associated with our Cluster
-     */
-    public Container getContainer();
-
-
-    // --------------------------------------------------------- Public Methods
 
     /**
      * Create a new manager which will use this cluster to replicate its
@@ -77,6 +59,7 @@ public interface Cluster {
      */
     public Manager createManager(String name);
 
+
     /**
      * Register a manager with the cluster. If the cluster is not responsible
      * for creating a manager, then the container will at least notify the
@@ -85,14 +68,13 @@ public interface Cluster {
      */
     public void registerManager(Manager manager);
 
+
     /**
      * Removes a manager from the cluster
      * @param manager Manager
      */
     public void removeManager(Manager manager);
 
-    // --------------------------------------------------------- Cluster Wide 
Deployments
-
 
     /**
      * Execute a periodic task, such as reloading, etc. This method will be

Modified: tomcat/trunk/java/org/apache/catalina/Pipeline.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Pipeline.java?rev=1771257&r1=1771256&r2=1771257&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Pipeline.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Pipeline.java Fri Nov 25 09:00:14 2016
@@ -14,11 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina;
 
-
 /**
  * <p>Interface describing a collection of Valves that should be executed
  * in sequence when the <code>invoke()</code> method is invoked.  It is
@@ -37,11 +34,7 @@ package org.apache.catalina;
  * @author Craig R. McClanahan
  * @author Peter Donald
  */
-public interface Pipeline {
-
-
-    // ------------------------------------------------------------- Properties
-
+public interface Pipeline extends Contained {
 
     /**
      * @return the Valve instance that has been distinguished as the basic
@@ -65,9 +58,6 @@ public interface Pipeline {
     public void setBasic(Valve valve);
 
 
-    // --------------------------------------------------------- Public Methods
-
-
     /**
      * <p>Add a new Valve to the end of the pipeline associated with this
      * Container.  Prior to adding the Valve, the Valve's
@@ -123,24 +113,10 @@ public interface Pipeline {
      */
     public Valve getFirst();
 
+
     /**
      * Returns true if all the valves in this pipeline support async, false 
otherwise
      * @return true if all the valves in this pipeline support async, false 
otherwise
      */
     public boolean isAsyncSupported();
-
-
-    /**
-     * @return the Container with which this Pipeline is associated.
-     */
-    public Container getContainer();
-
-
-    /**
-     * Set the Container with which this Pipeline is associated.
-     *
-     * @param container The new associated container
-     */
-    public void setContainer(Container container);
-
 }

Modified: tomcat/trunk/java/org/apache/catalina/Realm.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Realm.java?rev=1771257&r1=1771256&r2=1771257&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Realm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Realm.java Fri Nov 25 09:00:14 2016
@@ -35,30 +35,14 @@ import org.ietf.jgss.GSSContext;
  *
  * @author Craig R. McClanahan
  */
-public interface Realm {
-
-
-    // ------------------------------------------------------------- Properties
-
-    /**
-     * @return the Container with which this Realm has been associated.
-     */
-    public Container getContainer();
-
-
-    /**
-     * Set the Container with which this Realm has been associated.
-     *
-     * @param container The associated Container
-     */
-    public void setContainer(Container container);
-
+public interface Realm extends Contained {
 
     /**
      * @return the CredentialHandler configured for this Realm.
      */
     public CredentialHandler getCredentialHandler();
 
+
     /**
      * Set the CredentialHandler to be used by this Realm.
      *
@@ -67,8 +51,6 @@ public interface Realm {
     public void setCredentialHandler(CredentialHandler credentialHandler);
 
 
-    // --------------------------------------------------------- Public Methods
-
     /**
      * Add a property change listener to this component.
      *

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java?rev=1771257&r1=1771256&r2=1771257&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java Fri Nov 25 
09:00:14 2016
@@ -50,8 +50,7 @@ import org.apache.tomcat.util.ExceptionU
  * @author Craig R. McClanahan
  */
 
-public class StandardPipeline extends LifecycleBase
-        implements Pipeline, Contained {
+public class StandardPipeline extends LifecycleBase implements Pipeline {
 
     private static final Log log = LogFactory.getLog(StandardPipeline.class);
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1771257&r1=1771256&r2=1771257&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Nov 25 09:00:14 2016
@@ -103,6 +103,10 @@
         <code>HttpServletRequest#getRequestURL()</code> to reduce duplicate
         code. Duplicate code identified by the Simian tool. (markt)
       </scode>
+      <scode>
+        Refactor Catalina interfaces to make wider use of the
+        <code>Contained</code> interface and reduce duplication. (markt)
+      </scode>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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

Reply via email to