You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ch...@apache.org on 2007/12/21 22:09:12 UTC

svn commit: r606317 - /servicemix/smx4/runtime/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java

Author: chirino
Date: Fri Dec 21 13:09:11 2007
New Revision: 606317

URL: http://svn.apache.org/viewvc?rev=606317&view=rev
Log:
start listening for the START event sooner so that we don't miss it

Modified:
    servicemix/smx4/runtime/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java

Modified: servicemix/smx4/runtime/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/runtime/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java?rev=606317&r1=606316&r2=606317&view=diff
==============================================================================
--- servicemix/smx4/runtime/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java (original)
+++ servicemix/smx4/runtime/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java Fri Dec 21 13:09:11 2007
@@ -64,6 +64,14 @@
 
     public void start() {
         frameworkStarted = new CountDownLatch(1);
+		getBundleContext().addFrameworkListener(new FrameworkListener(){
+			public void frameworkEvent(FrameworkEvent event) {
+				log.debug("Got event: " + event.getType());
+				if( event.getType() == FrameworkEvent.STARTED ) {
+					frameworkStarted.countDown();
+				}
+			}
+		});
         if (start) {
             thread = new Thread(this);
             thread.start();
@@ -136,15 +144,6 @@
      * @throws InterruptedException
      */
     private void waitForFrameworkToStart() throws InterruptedException {
-		getBundleContext().addFrameworkListener(new FrameworkListener(){
-			public void frameworkEvent(FrameworkEvent event) {
-				log.debug("Got event: " + event.getType());
-				if( event.getType() == FrameworkEvent.STARTED ) {
-					frameworkStarted.countDown();
-				}
-			}
-		});
-
 		if( frameworkStarted.await(5, TimeUnit.SECONDS) ) {
 			log.info("System completed startup.");
 		} else {