directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccust...@apache.org
Subject svn commit: r606040 - in /directory: daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/ installers/trunk/ installers/trunk/apacheds-noarch/ installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/ installer...
Date Thu, 20 Dec 2007 22:24:31 GMT
Author: ccustine
Date: Thu Dec 20 14:24:30 2007
New Revision: 606040

URL: http://svn.apache.org/viewvc?rev=606040&view=rev
Log:
DIRSERVER-1114

Modified:
    directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
    directory/installers/trunk/apacheds-noarch/pom.xml
    directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
    directory/installers/trunk/apacheds/pom.xml
    directory/installers/trunk/pom.xml

Modified: directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java?rev=606040&r1=606039&r2=606040&view=diff
==============================================================================
--- directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
(original)
+++ directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
Thu Dec 20 14:24:30 2007
@@ -233,8 +233,8 @@
         String[] cmd = new String[]
             { rpmBuilder.getAbsolutePath(), "-ba", "--define", "_topdir " + target.getRpmTopDir().getAbsolutePath(),
rpmConfigurationFile.getAbsolutePath() };
         MojoHelperUtils.exec( cmd, target.getLayout().getBaseDirectory().getParentFile(),
target.isDoSudo() );
-        String rpmName = target.getApplication().getName() + "-" + version + "-0.i386.rpm";
-        File srcFile = new File( System.getProperty("user.home") + "/rpmbuild/RPMS/i386",
rpmName );
+        String rpmName = target.getApplication().getName() + "-" + version + "-0." + System.getProperty("os.arch")
+ ".rpm";
+        File srcFile = new File( System.getProperty("user.home") + "/rpmbuild/RPMS/" + System.getProperty("os.arch"),
rpmName );
         File dstFile = null;
 
         if ( target.getFinalName() == null )

Modified: directory/installers/trunk/apacheds-noarch/pom.xml
URL: http://svn.apache.org/viewvc/directory/installers/trunk/apacheds-noarch/pom.xml?rev=606040&r1=606039&r2=606040&view=diff
==============================================================================
--- directory/installers/trunk/apacheds-noarch/pom.xml (original)
+++ directory/installers/trunk/apacheds-noarch/pom.xml Thu Dec 20 14:24:30 2007
@@ -25,7 +25,7 @@
   </parent>
   <artifactId>apacheds-noarch-installer</artifactId>
   <name>ApacheDS Architecture Independent Installer</name>
-  <packaging>jar</packaging>  
+  <packaging>jar</packaging>
 
   <dependencies>
     <dependency>
@@ -35,18 +35,22 @@
 
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-ntp</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-server-xml</artifactId>
-    </dependency>  
+    </dependency>
 
     <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-bootstrap-partition</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.directory.daemon</groupId>
       <artifactId>daemon-bootstrappers</artifactId>
-    </dependency>  
+    </dependency>
 
     <dependency>
       <groupId>org.slf4j</groupId>
@@ -70,7 +74,6 @@
       <artifactId>log4j</artifactId>
       <scope>runtime</scope>
     </dependency>
-
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-core</artifactId>
@@ -85,6 +88,12 @@
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
     </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-xbean-spring</artifactId>
+    </dependency>
+
   </dependencies>
 
   <build>

Modified: directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
URL: http://svn.apache.org/viewvc/directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java?rev=606040&r1=606039&r2=606040&view=diff
==============================================================================
--- directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
(original)
+++ directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
Thu Dec 20 14:24:30 2007
@@ -20,24 +20,15 @@
 package org.apache.directory.server;
 
 
-import java.io.File;
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.directory.InitialDirContext;
-
 import org.apache.directory.daemon.DaemonApplication;
 import org.apache.directory.daemon.InstallationLayout;
-import org.apache.directory.server.configuration.MutableServerStartupConfiguration;
-import org.apache.directory.server.core.configuration.ShutdownConfiguration;
-import org.apache.directory.server.core.configuration.SyncConfiguration;
-import org.apache.directory.server.jndi.ServerContextFactory;
-
+import org.apache.directory.server.configuration.ApacheDS;
+import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+import java.io.File;
 
 
 /**
@@ -49,58 +40,29 @@
 public class Service implements DaemonApplication
 {
     private static final Logger log = LoggerFactory.getLogger( Service.class );
-    private Properties env;
     private Thread workerThread = null;
     private SynchWorker worker = new SynchWorker();
-    private MutableServerStartupConfiguration cfg;
-    private boolean startNoWait = false;
-
+    private ApacheDS apacheDS;
 
     public void init( InstallationLayout install, String[] args ) throws Exception
     {
         printBanner();
         long startTime = System.currentTimeMillis();
 
-//        if ( install != null )
-//        {
-//            log.info( "server: loading settings from ", install.getConfigurationFile()
);
-//            ApplicationContext factory = null;
-//            factory = new FileSystemXmlApplicationContext( install.getConfigurationFile().toURL().toString()
);
-//            cfg = ( MutableServerStartupConfiguration ) factory.getBean( "configuration"
);
-//            env = ( Properties ) factory.getBean( "environment" );
-//        }
-//        else if ( args.length > 0 && new File( args[0] ).exists() ) // hack
that takes server.xml file argument
-        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 = null;
-            factory = new FileSystemXmlApplicationContext( new File( args[0] ).toURI().toURL().toString()
);
-            cfg = ( MutableServerStartupConfiguration ) factory.getBean( "configuration"
);
-            env = ( Properties ) factory.getBean( "environment" );
-        }
-        else
-        {
-            log.info( "server: using default settings ..." );
-            env = new Properties();
-            cfg = new MutableServerStartupConfiguration();
-        }
-
-        env.setProperty( Context.PROVIDER_URL, "ou=system" );
-        env.setProperty( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName()
);
+        log.info( "server: loading settings from ", args[0] );
+        ApplicationContext factory;
+        File configFile = new File( args[0] );
+        factory = new FileSystemXmlApplicationContext( configFile.toURI().toURL().toString()
);
+        apacheDS = (ApacheDS) factory.getBean( "apacheDS" );
+        File workingDirFile = new File( configFile.getParentFile(), "work" );
+        apacheDS.getDirectoryService().setWorkingDirectory( workingDirFile );
+        apacheDS.startup();
 
-        if ( install != null )
-        {
-            cfg.setWorkingDirectory( install.getPartitionsDirectory() );
-        }
-
-        env.putAll( cfg.toJndiEnvironment() );
-        new InitialDirContext( env );
-
-        if ( cfg.getSynchPeriodMillis() > 0 )
+        if ( apacheDS.getSynchPeriodMillis() > 0 )
         {
             workerThread = new Thread( worker, "SynchWorkerThread" );
         }
-        
+
         if ( log.isInfoEnabled() )
         {
             log.info( "server: started in {} milliseconds", ( System.currentTimeMillis()
- startTime ) + "" );
@@ -110,8 +72,8 @@
 
     public void synch() throws Exception
     {
-        env.putAll( new SyncConfiguration().toJndiEnvironment() );
-        new InitialDirContext( env );
+//        env.putAll( new SyncConfiguration().toJndiEnvironment() );
+//        new InitialDirContext( env );
     }
 
 
@@ -127,23 +89,7 @@
 
     public void stop( String[] args ) throws Exception
     {
-        if ( workerThread != null )
-        {
-            worker.stop = true;
-            synchronized ( worker.lock )
-            {
-                worker.lock.notify();
-            }
-    
-            while ( startNoWait && workerThread.isAlive() )
-            {
-                log.info( "Waiting for SynchWorkerThread to die." );
-                workerThread.join( 500 );
-            }
-        }
-
-        env.putAll( new ShutdownConfiguration().toJndiEnvironment() );
-        new InitialDirContext( env );
+        apacheDS.getDirectoryService().shutdown();
     }
 
 
@@ -151,7 +97,7 @@
     {
     }
 
-    
+
     class SynchWorker implements Runnable
     {
         Object lock = new Object();
@@ -166,7 +112,7 @@
                 {
                     try
                     {
-                        lock.wait( cfg.getSynchPeriodMillis() );
+                        lock.wait( apacheDS.getSynchPeriodMillis() );
                     }
                     catch ( InterruptedException e )
                     {

Modified: directory/installers/trunk/apacheds/pom.xml
URL: http://svn.apache.org/viewvc/directory/installers/trunk/apacheds/pom.xml?rev=606040&r1=606039&r2=606040&view=diff
==============================================================================
--- directory/installers/trunk/apacheds/pom.xml (original)
+++ directory/installers/trunk/apacheds/pom.xml Thu Dec 20 14:24:30 2007
@@ -36,7 +36,7 @@
       <groupId>org.apache.directory.installers</groupId>
       <artifactId>apacheds-noarch-installer</artifactId>
       <version>${pom.version}</version>
-    </dependency>  
+    </dependency>
 
     <dependency>
       <groupId>org.apache.directory.server</groupId>
@@ -158,7 +158,7 @@
           <plugin>
             <groupId>org.apache.directory.daemon</groupId>
             <artifactId>daemon-plugin</artifactId>
-            <version>1.1.1</version>
+            <version>1.1.2-SNAPSHOT</version>
             <configuration>
               <application>
                 <name>suite</name>
@@ -310,7 +310,7 @@
           <plugin>
             <groupId>org.apache.directory.daemon</groupId>
             <artifactId>daemon-plugin</artifactId>
-            <version>1.1.1</version>
+            <version>1.1.2-SNAPSHOT</version>
             <configuration>
               <application>
                 <name>studio</name>
@@ -422,7 +422,7 @@
           <plugin>
             <groupId>org.apache.directory.daemon</groupId>
             <artifactId>daemon-plugin</artifactId>
-            <version>1.1.1</version>
+            <version>1.1.2-SNAPSHOT</version>
             <configuration>
               <excludes>
 

Modified: directory/installers/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/installers/trunk/pom.xml?rev=606040&r1=606039&r2=606040&view=diff
==============================================================================
--- directory/installers/trunk/pom.xml (original)
+++ directory/installers/trunk/pom.xml Thu Dec 20 14:24:30 2007
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.directory.project</groupId>
     <artifactId>project</artifactId>
-    <version>8</version>
+    <version>9-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.directory.installers</groupId>
@@ -73,6 +73,18 @@
 
       <dependency>
         <groupId>org.apache.directory.server</groupId>
+        <artifactId>apacheds-xbean-spring</artifactId>
+        <version>1.5.2-SNAPSHOT</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.directory.server</groupId>
+        <artifactId>apacheds-protocol-ntp</artifactId>
+        <version>1.5.2-SNAPSHOT</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.directory.server</groupId>
         <artifactId>apacheds-bootstrap-partition</artifactId>
         <version>1.5.2-SNAPSHOT</version>
       </dependency>
@@ -258,6 +270,12 @@
       </dependency>
 
       <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-spring</artifactId>
+        <version>3.2</version>
+      </dependency>
+
+      <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-archiver</artifactId>
         <version>2.2</version>
@@ -317,6 +335,16 @@
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-spring</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-server-jndi</artifactId>
     </dependency>
 
     <!-- apacheds standard logging interface -->



Mime
View raw message