directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1021744 - in /directory/apacheds/trunk/service/src/main/java/org/apache/directory/server: ApacheDsService.java UberjarMain.java
Date Tue, 12 Oct 2010 11:28:39 GMT
Author: kayyagari
Date: Tue Oct 12 11:28:39 2010
New Revision: 1021744

URL: http://svn.apache.org/viewvc?rev=1021744&view=rev
Log:
o renamed initXXX() methods to startXXX() to actually reflect their actual implementation
behavior
o removed useless methods 

Modified:
    directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java
    directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java

Modified: directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java?rev=1021744&r1=1021743&r2=1021744&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java
(original)
+++ directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java
Tue Oct 12 11:28:39 2010
@@ -74,7 +74,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * DirectoryServer bean used by both the daemon code and by the ServerMain here.
+ * A class used to start various servers in a give {@link InstanceLayout}
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -123,7 +123,14 @@ public class ApacheDsService
     private boolean isSchemaPartitionFirstExtraction = false;
 
 
-    public void init( InstanceLayout instanceLayout ) throws Exception
+    /**
+     * starts various services configured according to the 
+     * configuration present in the given instance's layout
+     *
+     * @param instanceLayout the on disk location's layout of the intance to be started
+     * @throws Exception
+     */
+    public void start( InstanceLayout instanceLayout ) throws Exception
     {
         File partitionsDir = instanceLayout.getPartitionsDirectory();
         if ( !partitionsDir.exists() )
@@ -138,11 +145,11 @@ public class ApacheDsService
 
         cpReader = new ConfigPartitionReader( configPartition, partitionsDir );
 
-        // Initialize the LDAP server
-        initLdap( instanceLayout );
+        // start the LDAP server
+        startLdap( instanceLayout );
 
-        // Initialize the NTP server
-        initNtp();
+        // start the NTP server
+        startNtp();
 
         // Initialize the DNS server (Not ready yet)
         // initDns( layout );
@@ -150,14 +157,14 @@ public class ApacheDsService
         // Initialize the DHCP server (Not ready yet)
         // initDhcp( layout );
 
-        // Initialize the ChangePwd server (Not ready yet)
-        initChangePwd();
+        // start the ChangePwd server (Not ready yet)
+        startChangePwd();
 
-        // Initialize the Kerberos server
-        initKerberos();
+        // start the Kerberos server
+        startKerberos();
 
-        // initialize the jetty http server
-        initHttpServer();
+        // start the jetty http server
+        startHttpServer();
     }
 
 
@@ -236,9 +243,9 @@ public class ApacheDsService
 
 
     /**
-     * Initialize the LDAP server
+     * start the LDAP server
      */
-    private void initLdap( InstanceLayout instanceLayout ) throws Exception
+    private void startLdap( InstanceLayout instanceLayout ) throws Exception
     {
         LOG.info( "Starting the LDAP server" );
 
@@ -302,7 +309,14 @@ public class ApacheDsService
         }
 
         // And start the server now
-        start();
+        try
+        {
+            ldapServer.start();
+        }
+        catch ( Exception e )
+        {
+            LOG.error( "Cannot start the server : " + e.getMessage() );
+        }
 
         if ( LOG.isInfoEnabled() )
         {
@@ -312,9 +326,9 @@ public class ApacheDsService
 
 
     /**
-     * Initialize the NTP server
+     * start the NTP server
      */
-    private void initNtp() throws Exception
+    private void startNtp() throws Exception
     {
         ntpServer = cpReader.createNtpServer();
         if ( ntpServer == null )
@@ -376,9 +390,9 @@ public class ApacheDsService
     //    }
 
     /**
-     * Initialize the KERBEROS server
+     * start the KERBEROS server
      */
-    private void initKerberos() throws Exception
+    private void startKerberos() throws Exception
     {
         kdcServer = cpReader.createKdcServer();
         if ( kdcServer == null )
@@ -409,9 +423,9 @@ public class ApacheDsService
 
 
     /**
-     * Initialize the Change Password server
+     * start the Change Password server
      */
-    private void initChangePwd() throws Exception
+    private void startChangePwd() throws Exception
     {
 
         changePwdServer = cpReader.createChangePwdServer();
@@ -442,7 +456,10 @@ public class ApacheDsService
     }
 
 
-    private void initHttpServer() throws Exception
+    /**
+     * start the embedded HTTP server
+     */
+    private void startHttpServer() throws Exception
     {
         httpServer = cpReader.createHttpServer();
         if ( httpServer == null )
@@ -471,19 +488,6 @@ public class ApacheDsService
     }
 
 
-    public void start()
-    {
-        try
-        {
-            ldapServer.start();
-        }
-        catch ( Exception e )
-        {
-            LOG.error( "Cannot start the server : " + e.getMessage() );
-        }
-    }
-
-
     public void stop() throws Exception
     {
         // Stops the server
@@ -517,10 +521,6 @@ public class ApacheDsService
     }
 
 
-    public void destroy()
-    {
-    }
-
     private static final String BANNER_LDAP = "           _                     _       
  ____  ____   \n"
         + "          / \\   _ __    ___  ___| |__   ___|  _ \\/ ___|  \n"
         + "         / _ \\ | '_ \\ / _` |/ __| '_ \\ / _ \\ | | \\___ \\  \n"

Modified: directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java?rev=1021744&r1=1021743&r2=1021744&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java
(original)
+++ directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java
Tue Oct 12 11:28:39 2010
@@ -25,8 +25,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The command line main for the server.  Warning this used to be a simple test
- * case so there really is not much here.
+ * The command line main for the server.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -55,7 +54,7 @@ public class UberjarMain
             // Initializing the service
             try
             {
-                service.init( instanceLayout );
+                service.start( instanceLayout );
             }
             catch ( Exception e )
             {



Mime
View raw message