User: chirino 
  Date: 01/10/03 19:54:19

  Modified:    src/main/org/jboss/mq Connection.java
  Log:
  Finnaly got the initialization of the clockDaemon right.  The thread was not being 
created as a deamon thread and therefor would not let VMs exit correctly when the 
connection was shutdown.
  
  Revision  Changes    Path
  1.10      +19 -14    jbossmq/src/main/org/jboss/mq/Connection.java
  
  Index: Connection.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Connection.java   2001/10/02 03:52:55     1.9
  +++ Connection.java   2001/10/04 02:54:19     1.10
  @@ -38,7 +38,7 @@
    *
    * @author    Norbert Lataille ([EMAIL PROTECTED])
    * @author    Hiram Chirino ([EMAIL PROTECTED])
  - * @version   $Revision: 1.9 $
  + * @version   $Revision: 1.10 $
    * @created   August 16, 2001
    */
   public class Connection implements java.io.Serializable, javax.jms.Connection
  @@ -137,6 +137,23 @@
      private StringBuffer sb = new StringBuffer();
      private char[] charStack = new char[22];
   
  +   /**
  +    * Static class initializer..
  +    */
  +   static {
  +      cat.debug("Setting the clockDaemon's thread factory");
  +      clockDaemon.setThreadFactory(
  +         new ThreadFactory () {
  +            public Thread newThread(Runnable r) {
  +               Thread t = new Thread(threadGroup, r, "Connection Monitor Thread");
  +               t.setDaemon(true);
  +               return t;
  +            }
  +         }
  +
  +      );
  +   }
  +   
      //////////////////////////////////////////////////////////////
      // Constructors
      //////////////////////////////////////////////////////////////
  @@ -1020,20 +1037,8 @@
         // ping period is 0.
         if( pingPeriod == 0 )
            return;
  -      if( clockDaemon.getThreadFactory() == null ) {
  -         cat.debug("Setting the clockDaemon's thread factory");
  -         clockDaemon.setThreadFactory(
  -            new ThreadFactory () {
  -               public Thread newThread(Runnable r) {
  -                  Thread t = new Thread(threadGroup, r, "Connection Monitor 
Thread");
  -                  t.setDaemon(true);
  -                  return t;
  -               }
  -            }
  -
  -         );
  -      }
         pingTaskId = clockDaemon.executePeriodically(pingPeriod,new PingTask(), true);
  +      
      }
      
      private void stopPingThread() {
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to