costin      2003/04/02 16:54:34

  Modified:    jk/java/org/apache/jk/common ChannelSocket.java
  Log:
  Unregister on shutdown.
  
  Revision  Changes    Path
  1.36      +12 -2     
jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java
  
  Index: ChannelSocket.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- ChannelSocket.java        28 Feb 2003 20:47:59 -0000      1.35
  +++ ChannelSocket.java        3 Apr 2003 00:54:33 -0000       1.36
  @@ -73,6 +73,7 @@
   import javax.management.ListenerNotFoundException;
   import javax.management.MBeanNotificationInfo;
   import javax.management.Notification;
  +import javax.management.ObjectName;
   
   
   /* XXX Make the 'message type' pluggable
  @@ -368,8 +369,9 @@
           // XXX Try to find a thread first - not sure how...
           if( this.domain != null ) {
               try {
  -                Registry.getRegistry().registerComponent(tp, domain,"ThreadPool",
  -                        "type=ThreadPool,name=jk" + port);
  +                tpOName=new ObjectName(domain + ":type=ThreadPool,name=jk" + port);
  +
  +                Registry.getRegistry().registerComponent(tp, tpOName, null);
               } catch (Exception e) {
                   log.error("Can't register threadpool" );
               }
  @@ -381,6 +383,8 @@
           tp.runIt( acceptAjp);
       }
   
  +    ObjectName tpOName;
  +    
       public void start() throws IOException{
           if( sSocket==null )
               init();
  @@ -419,6 +423,10 @@
               }
               s.close();
               sSocket.close(); // XXX?
  +            
  +            if( tpOName != null )  {
  +                Registry.getRegistry().unregisterComponent(tpOName);
  +            }
           } catch(Exception e) {
               log.info("Error shutting down the channel " + port + " " +
                       e.toString());
  @@ -565,6 +573,8 @@
   
                   if( !running ) break;
                   
  +                // Since this is a long-running connection, we don't care
  +                // about the small GC
                   SocketConnection ajpConn=
                       new SocketConnection(this, ep);
                   tp.runIt( ajpConn );
  
  
  

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

Reply via email to