User: starksm 
  Date: 01/05/03 23:06:47

  Modified:    src/main/org/jboss/jdbc HypersonicDatabase.java
  Log:
  The startService method can't wait on a JMX log notification when log4j
  is used to remove this code as it stalls the startup for 30 secs.
  
  Revision  Changes    Path
  1.6       +6 -42     jboss/src/main/org/jboss/jdbc/HypersonicDatabase.java
  
  Index: HypersonicDatabase.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jdbc/HypersonicDatabase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HypersonicDatabase.java   2000/12/07 15:44:50     1.5
  +++ HypersonicDatabase.java   2001/05/04 06:06:47     1.6
  @@ -27,11 +27,12 @@
    *      
    *   @see HypersonicDatabaseMBean
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.5 $
  + *   @author [EMAIL PROTECTED]
  + *   @version $Revision: 1.6 $
    */
   public class HypersonicDatabase
      extends ServiceMBeanSupport
  -   implements HypersonicDatabaseMBean, MBeanRegistration, NotificationListener
  +   implements HypersonicDatabaseMBean, MBeanRegistration
   {
      // Constants -----------------------------------------------------
       
  @@ -109,9 +110,6 @@
      public void startService()
         throws Exception
      {
  -      // Register as log listener
  -      server.addNotificationListener(new 
ObjectName(server.getDefaultDomain(),"service","Log"),this,null,null);
  -   
         // Start DB in new thread, or else it will block us
         runner = new Thread(new Runnable()
         {
  @@ -133,47 +131,13 @@
               
               // Start server
               org.hsql.Server.main(args);
  -            
  -            // Now wait for "Server x.x is running" message
            }
         });
  -      
  +
         // Wait for startup message
  -      try
  -      {
  -         synchronized (runner)
  -         {
  -            runner.start();
  -            runner.wait(30000); // Wait for database to start; timeout = not started
  -         }
  -      } finally
  -      {
  -         try
  -         {
  -            server.removeNotificationListener(new 
ObjectName(server.getDefaultDomain(),"service","Log"), this);
  -         } catch (ListenerNotFoundException e)
  -         {
  -            // Ignore
  -         }
  -      }
  +      runner.start();
         log.log("Database started");
      }
  -   
  -   // NotificationListener implementation ---------------------------
  -   public void handleNotification(Notification n,
  -                                  java.lang.Object handback)
  -   {
  -      if (n.getUserData().toString().equals(getName()))
  -      {
  -         if (n.getMessage().endsWith("is running"))
  -         {
  -            // Notify other thread that DB is now started
  -            synchronized(runner)
  -            {
  -               runner.notify();
  -            }
  -         }
  -      }
  -   }
  +
      // Protected -----------------------------------------------------
   }
  
  
  

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

Reply via email to