You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by na...@apache.org on 2001/09/24 00:14:35 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server JNIEndpoint.java JNIConnectionHandler.java

nacho       01/09/23 15:14:35

  Modified:    src/share/org/apache/tomcat/modules/server JNIEndpoint.java
                        JNIConnectionHandler.java
  Log:
  Adding shutdown to JNI.
  
  Revision  Changes    Path
  1.7       +3 -3      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/JNIEndpoint.java
  
  Index: JNIEndpoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/JNIEndpoint.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JNIEndpoint.java	2001/09/23 18:10:11	1.6
  +++ JNIEndpoint.java	2001/09/23 22:14:35	1.7
  @@ -197,13 +197,13 @@
           return 0;
       }
   
  -    public void shutdown()
  -    {
  -        System.out.println("JNI In shutdown");
  +    public void shutdown(){
  +        handler.shutdown();
       }
   
       public static interface JniHandler {
   	public void processConnection( long s, long l );
  +	public void shutdown();
       }
   }
   
  
  
  
  1.15      +13 -4     jakarta-tomcat/src/share/org/apache/tomcat/modules/server/JNIConnectionHandler.java
  
  Index: JNIConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/JNIConnectionHandler.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JNIConnectionHandler.java	2001/09/23 18:10:11	1.14
  +++ JNIConnectionHandler.java	2001/09/23 22:14:35	1.15
  @@ -134,10 +134,10 @@
       }
   
       // ==================== callbacks from web server ====================
  -    
  +
       static Vector pool=new Vector();
       static boolean reuse=true;
  -    
  +
       /** Called from the web server for each request
        *  You can extend JNIConnectionHandler and implement a different
        *  JNIRequest/JNIResponse. Set the new handler on the JNIEndpoint,
  @@ -151,7 +151,7 @@
   	JNIResponseAdapter resA=null;
   
           try {
  -	    
  +
   	    if( reuse ) {
   		synchronized( this ) {
   		    if( pool.size()==0 ) {
  @@ -171,7 +171,7 @@
   		resA =new JNIResponseAdapter(this);
   		cm.initRequest( reqA , resA );
   	    }
  -	    
  +
               resA.setRequestAttr(s, l);
       	    reqA.readNextRequest(s, l);
   
  @@ -193,6 +193,15 @@
   	}
       }
   
  +    public void shutdown()
  +    {
  +        try{
  +            cm.log("Shutdown from JNI" );
  +            cm.shutdown();
  +        } catch (Throwable t){
  +            cm.log("Exception while JNI shutdown",t);
  +        }
  +    }
       // -------------------- Find the native library --------------------
   
       private void initLibrary()