directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r586083 - /directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
Date Thu, 18 Oct 2007 19:00:40 GMT
Author: djencks
Date: Thu Oct 18 12:00:39 2007
New Revision: 586083

URL: http://svn.apache.org/viewvc?rev=586083&view=rev
Log:
expose DirectoryService, actually shut down the server on stop

Modified:
    directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java

Modified: directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
URL: http://svn.apache.org/viewvc/directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java?rev=586083&r1=586082&r2=586083&view=diff
==============================================================================
--- directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
(original)
+++ directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
Thu Oct 18 12:00:39 2007
@@ -20,6 +20,8 @@
 package org.apache.directory.server;
 
 
+import java.io.File;
+
 import org.apache.directory.daemon.DaemonApplication;
 import org.apache.directory.daemon.InstallationLayout;
 import org.apache.directory.server.configuration.ApacheDS;
@@ -30,9 +32,6 @@
 import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-
-import java.io.File;
 
 
 /**
@@ -47,6 +46,7 @@
     private Thread workerThread;
     private SynchWorker worker = new SynchWorker();
     private ApacheDS apacheDS;
+    private FileSystemXmlApplicationContext factory;
 
 
     public void init( InstallationLayout install, String[] args ) throws Exception
@@ -57,7 +57,7 @@
         if ( args.length > 0 && new File( args[0] ).exists() ) // hack that takes
server.xml file argument
         {
             LOG.info( "server: loading settings from ", args[0] );
-            ApplicationContext factory = new FileSystemXmlApplicationContext( new File( args[0]
).toURI().toURL().toString() );
+            factory = new FileSystemXmlApplicationContext( new File( args[0] ).toURI().toURL().toString()
);
             apacheDS = ( ApacheDS ) factory.getBean( "apacheDS" );
         }
         else
@@ -76,6 +76,7 @@
             ldapsServer.setDirectoryService( directoryService );
             ldapsServer.start();
             apacheDS = new ApacheDS( directoryService, ldapServer, ldapsServer );
+            apacheDS.startup();
         }
 
         if ( install != null )
@@ -96,6 +97,10 @@
         }
     }
 
+    public DirectoryService getDirectoryService() {
+        return apacheDS.getDirectoryService();
+    }
+
 
     public void synch() throws Exception
     {
@@ -129,6 +134,10 @@
             }
         }
 
+        if (factory != null)
+        {
+            factory.close();
+        }
         apacheDS.shutdown();
     }
 



Mime
View raw message