directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r372795 - /directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/
Date Fri, 27 Jan 2006 09:26:47 GMT
Author: akarasulu
Date: Fri Jan 27 01:26:41 2006
New Revision: 372795

URL: http://svn.apache.org/viewcvs?rev=372795&view=rev
Log:
changes ...

 o added nowait option to start so it can block for procrun but not other
   bootstrappers which do not need it.
 o renaming BootstrappedApplication to ApplicationLifecycleInvoker

Added:
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ApplicationLifecycleInvoker.java
      - copied, changed from r372793, directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/BootstrappedApplication.java
Removed:
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/BootstrappedApplication.java
Modified:
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/MainBootstrapper.java
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ProcrunBootstrapper.java

Copied: directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ApplicationLifecycleInvoker.java
(from r372793, directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/BootstrappedApplication.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ApplicationLifecycleInvoker.java?p2=directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ApplicationLifecycleInvoker.java&p1=directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/BootstrappedApplication.java&r1=372793&r2=372795&rev=372795&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/BootstrappedApplication.java
(original)
+++ directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ApplicationLifecycleInvoker.java
Fri Jan 27 01:26:41 2006
@@ -33,9 +33,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class BootstrappedApplication
+public class ApplicationLifecycleInvoker
 {
-    private static Logger log = LoggerFactory.getLogger( BootstrappedApplication.class );
+    private static Logger log = LoggerFactory.getLogger( ApplicationLifecycleInvoker.class
);
     private static final String BOOTSTRAP_START_CLASS_PROP = "bootstrap.start.class";
     private static final String BOOTSTRAP_STOP_CLASS_PROP = "bootstrap.stop.class";
 
@@ -47,7 +47,7 @@
     private final InstallationLayout layout;
 
 
-    public BootstrappedApplication( String installationBase, ClassLoader parent )
+    public ApplicationLifecycleInvoker( String installationBase, ClassLoader parent )
     {
         layout = new InstallationLayout( installationBase );
         
@@ -182,7 +182,7 @@
     }
 
 
-    public void callStart()
+    public void callStart( boolean nowait )
     {
         Thread.currentThread().setContextClassLoader( application );
         Class clazz = startObject.getClass();
@@ -190,7 +190,7 @@
         
         try
         {
-            op = clazz.getMethod( "start", null );
+            op = clazz.getMethod( "start", new Class[] { Boolean.class } );
         }
         catch ( Exception e )
         {
@@ -200,7 +200,7 @@
         
         try
         {
-            op.invoke( startObject, null );
+            op.invoke( startObject, new Object[] { new Boolean( nowait ) } );
         }
         catch ( Exception e )
         {

Modified: directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java?rev=372795&r1=372794&r2=372795&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java
(original)
+++ directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java
Fri Jan 27 01:26:41 2006
@@ -33,7 +33,7 @@
 public class JsvcBootstrapper implements Daemon
 {
     private final static Logger log = LoggerFactory.getLogger( JsvcBootstrapper.class );
-    private BootstrappedApplication application;
+    private ApplicationLifecycleInvoker application;
     
     
     public void init( DaemonContext arg ) throws Exception
@@ -51,7 +51,7 @@
 
         if ( application == null )
         {
-            application = new BootstrappedApplication( arg.getArguments()[0], 
+            application = new ApplicationLifecycleInvoker( arg.getArguments()[0], 
                 Thread.currentThread().getContextClassLoader() );
         }
         
@@ -74,7 +74,7 @@
 
         if ( application == null )
         {
-            application = new BootstrappedApplication( args[0], Thread.currentThread().getContextClassLoader()
);
+            application = new ApplicationLifecycleInvoker( args[0], Thread.currentThread().getContextClassLoader()
);
         }
         
         application.callInit();
@@ -84,7 +84,7 @@
     public void start()
     {
         log.debug( "start() called" );
-        application.callStart();
+        application.callStart( true );
     }
 
 

Modified: directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/MainBootstrapper.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/MainBootstrapper.java?rev=372795&r1=372794&r2=372795&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/MainBootstrapper.java
(original)
+++ directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/MainBootstrapper.java
Fri Jan 27 01:26:41 2006
@@ -55,11 +55,11 @@
             }
         }
 
-        BootstrappedApplication application = null;
+        ApplicationLifecycleInvoker application = null;
         if ( args.length > 1 )
         {
-        	log.debug( "main(String[]) creating BootstrappedApplication ... )" );
-            application = new BootstrappedApplication( args[0], Thread.currentThread().getContextClassLoader()
);
+        	log.debug( "main(String[]) creating ApplicationLifecycleInvoker ... )" );
+            application = new ApplicationLifecycleInvoker( args[0], Thread.currentThread().getContextClassLoader()
);
         }
         else
         {
@@ -79,7 +79,7 @@
                 application.callInit();
 
                 log.debug( "calling application.callStart(String[]) from main(String[])"
);
-                application.callStart();
+                application.callStart( true );
             }
             else if ( command.equalsIgnoreCase( "stop" ) )
             {

Modified: directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ProcrunBootstrapper.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ProcrunBootstrapper.java?rev=372795&r1=372794&r2=372795&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ProcrunBootstrapper.java
(original)
+++ directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/ProcrunBootstrapper.java
Fri Jan 27 01:26:41 2006
@@ -51,26 +51,14 @@
             System.exit( ExitCodes.BAD_ARGUMENTS );
         }
 
-        log.debug( "prunsrvStart(String[]) creating BootstrappedApplication ... )" );
-        BootstrappedApplication application = new BootstrappedApplication( args[0], 
+        log.debug( "prunsrvStart(String[]) creating ApplicationLifecycleInvoker ... )" );
+        ApplicationLifecycleInvoker application = new ApplicationLifecycleInvoker( args[0],

             Thread.currentThread().getContextClassLoader() );
 
         log.debug( "prunsrvStart(String[]) invoking application.callInit())" );
         application.callInit();
         log.debug( "prunsrvStart(String[]) invoking bootstrapper.callStart())" );
-        application.callStart();
-        
-        while( true )
-        {
-            try
-            {
-                Thread.sleep( 2000 );
-            }
-            catch ( InterruptedException e )
-            {
-                e.printStackTrace();
-            }
-        }
+        application.callStart( false ); // must block on start (let the app decide how)
     }
 
     
@@ -92,8 +80,8 @@
             System.exit( ExitCodes.BAD_ARGUMENTS );
         }
 
-        log.debug( "prunsrvStop(String[]) creating BootstrappedApplication ... )" );
-        BootstrappedApplication application = new BootstrappedApplication( args[0], 
+        log.debug( "prunsrvStop(String[]) creating ApplicationLifecycleInvoker ... )" );
+        ApplicationLifecycleInvoker application = new ApplicationLifecycleInvoker( args[0],

             Thread.currentThread().getContextClassLoader() );
         
         log.debug( "prunsrvStop(String[]) invoking application.callStop())" );



Mime
View raw message