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...@locus.apache.org on 2000/07/29 03:32:56 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service JNIEndpointConnector.java PoolTcpConnector.java

costin      00/07/28 18:32:56

  Modified:    src/share/org/apache/tomcat/service
                        JNIEndpointConnector.java PoolTcpConnector.java
  Log:
  The connectors now extend BaseInterceptor ( and implement ContextInterceptor).
  
  It seems we don't need a specialized interface, the connectors are addapters
  between tomcat.core and the web server and by implementing ContextInterceptor
  they have far more control and the model is much simpler.
  
  We'll keep the ServerConnector interface for a while - maybe someone is using it.
  
  Revision  Changes    Path
  1.5       +24 -4     jakarta-tomcat/src/share/org/apache/tomcat/service/JNIEndpointConnector.java
  
  Index: JNIEndpointConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/JNIEndpointConnector.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JNIEndpointConnector.java	2000/07/11 03:48:54	1.4
  +++ JNIEndpointConnector.java	2000/07/29 01:32:56	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/JNIEndpointConnector.java,v 1.4 2000/07/11 03:48:54 alex Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/07/11 03:48:54 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/JNIEndpointConnector.java,v 1.5 2000/07/29 01:32:56 costin Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/07/29 01:32:56 $
    *
    * ====================================================================
    *
  @@ -78,7 +78,7 @@
    *
    * @author Gal Shachor <sh...@il.ibm.com>
    */
  -public class JNIEndpointConnector  implements ServerConnector {
  +public class JNIEndpointConnector  extends BaseInterceptor implements ServerConnector {
       // XXX define ConnectorException
       // XXX replace strings with sm.get...
       // XXX replace static strings with constants
  @@ -98,6 +98,26 @@
   
       public JNIEndpointConnector() {
       }
  +
  +    /** Called when the ContextManger is started
  +     */
  +    public void engineInit(ContextManager cm) throws TomcatException {
  +	this.cm=cm;
  +	try {
  +	    start();
  +	} catch( Exception ex ) {
  +	    throw new TomcatException( ex );
  +	}
  +    }
  +
  +    public void engineShutdown(ContextManager cm) throws TomcatException {
  +	try {
  +	    stop();
  +	} catch( Exception ex ) {
  +	    throw new TomcatException( ex );
  +	}
  +    }
  +
   
       public void start() throws Exception
       {
  
  
  
  1.11      +21 -1     jakarta-tomcat/src/share/org/apache/tomcat/service/PoolTcpConnector.java
  
  Index: PoolTcpConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/PoolTcpConnector.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PoolTcpConnector.java	2000/07/11 08:09:32	1.10
  +++ PoolTcpConnector.java	2000/07/29 01:32:56	1.11
  @@ -86,7 +86,7 @@
    * @author costin@eng.sun.com
    * @author Gal Shachor [shachor@il.ibm.com]
    */
  -public final class PoolTcpConnector implements ServerConnector, LogAware {
  +public final class PoolTcpConnector extends BaseInterceptor implements ServerConnector, LogAware {
       // Attributes we accept ( to support the old model of
       // configuration, will be deprecated )
       public static final String VHOST_PORT="vhost_port";
  @@ -139,6 +139,26 @@
       }
   
       // -------------------- Start/stop --------------------
  +
  +    /** Called when the ContextManger is started
  +     */
  +    public void engineInit(ContextManager cm) throws TomcatException {
  +	this.cm=cm;
  +	try {
  +	    start();
  +	} catch( Exception ex ) {
  +	    throw new TomcatException( ex );
  +	}
  +    }
  +
  +    public void engineShutdown(ContextManager cm) throws TomcatException {
  +	try {
  +	    stop();
  +	} catch( Exception ex ) {
  +	    throw new TomcatException( ex );
  +	}
  +    }
  +
       
       public void start() throws Exception {
       	if(con==null)