directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r373128 - /directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java
Date Sat, 28 Jan 2006 10:50:49 GMT
Author: akarasulu
Date: Sat Jan 28 02:50:45 2006
New Revision: 373128

URL: http://svn.apache.org/viewcvs?rev=373128&view=rev
Log:
using callXxxx methods in JsvcBootstrapper as well

Modified:
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java

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=373128&r1=373127&r2=373128&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
Sat Jan 28 02:50:45 2006
@@ -17,9 +17,6 @@
 package org.apache.directory.server.standalone.daemon;
 
 
-import org.apache.commons.daemon.Daemon;
-import org.apache.commons.daemon.DaemonContext;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -30,45 +27,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class JsvcBootstrapper implements Daemon
+public class JsvcBootstrapper extends Bootstrapper
 {
     private final static Logger log = LoggerFactory.getLogger( JsvcBootstrapper.class );
-    private static final String[] EMPTY_STRARRAY = new String[0];
-    private LifecycleInvoker invoker;
-    
-    
-    public void init( DaemonContext arg ) throws Exception
-    {
-        if ( log.isDebugEnabled() )
-        {
-            StringBuffer buf = new StringBuffer();
-            buf.append( "init(DaemonContext) called with args: \n" );
-            for ( int ii = 0; ii < arg.getArguments().length; ii++ )
-            {
-                buf.append( "\t" ).append( arg.getArguments()[ii] ).append( "\n" );
-            }
-            log.debug( buf.toString() );
-        }
 
-        if ( invoker == null )
-        {
-            invoker = new LifecycleInvoker( arg.getArguments()[0], 
-                Thread.currentThread().getContextClassLoader() );
-        }
-        
-        if ( arg.getArguments().length > 1 )
-        {
-            String[] shifted = new String[arg.getArguments().length-1];
-            System.arraycopy( arg.getArguments(), 1, shifted, 0, shifted.length );
-            invoker.callInit( shifted );
-        }
-        else
-        {
-            invoker.callInit( EMPTY_STRARRAY );
-        }
-    }
     
-
     public void init( String[] args )
     {
         if ( log.isDebugEnabled() )
@@ -82,41 +45,44 @@
             log.debug( buf.toString() );
         }
 
-        if ( invoker == null )
-        {
-            invoker = new LifecycleInvoker( args[0], Thread.currentThread().getContextClassLoader()
);
-        }
-        
-        if ( args.length > 1 )
-        {
-            String[] shifted = new String[args.length-1];
-            System.arraycopy( args, 1, shifted, 0, shifted.length );
-            invoker.callInit( shifted );
-        }
-        else
-        {
-            invoker.callInit( EMPTY_STRARRAY );
-        }
+        setInstallationLayout( args[0] );
+        setParentLoader( Thread.currentThread().getContextClassLoader() );
+        callInit();
+
+//        if ( args.length > 1 )
+//        {
+//            String[] shifted = new String[args.length-1];
+//            System.arraycopy( args, 1, shifted, 0, shifted.length );
+//            setInstallationLayout( args[0] );
+//            setParentLoader( Thread.currentThread().getContextClassLoader() );
+//            callInit();
+//        }
+//        else
+//        {
+//            callInit( EMPTY_STRARRAY );
+//        }
     }
     
     
     public void start()
     {
         log.debug( "start() called" );
-        invoker.callStart( true );
+        callStart();
+//      callStart( true );
     }
 
 
     public void stop() throws Exception
     {
         log.debug( "stop() called" );
-        invoker.callStop( EMPTY_STRARRAY );
+        callStop();
+        //callStop( EMPTY_STRARRAY );
     }
 
 
     public void destroy()
     {
         log.debug( "destroy() called" );
-        invoker.callDestroy();
+        callDestroy();
     }
 }



Mime
View raw message