directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r516238 - in /directory/apacheds/branches/apacheds-sasl-branch/server-jndi: pom.xml src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
Date Fri, 09 Mar 2007 00:26:27 GMT
Author: erodriguez
Date: Thu Mar  8 16:26:26 2007
New Revision: 516238

URL: http://svn.apache.org/viewvc?view=rev&rev=516238
Log:
Replaced initialization of LDAPS using reflection in branch.  Updated POM to include apacheds-server-ssl.

Modified:
    directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml
    directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml?view=diff&rev=516238&r1=516237&r2=516238
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml Thu Mar  8 16:26:26
2007
@@ -51,6 +51,11 @@
       <artifactId>apacheds-core</artifactId>
       <version>${pom.version}</version>
     </dependency>  
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-server-ssl</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
   </dependencies>
 </project>
 

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?view=diff&rev=516238&r1=516237&r2=516238
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
Thu Mar  8 16:26:26 2007
@@ -23,7 +23,6 @@
 import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.Hashtable;
@@ -52,6 +51,7 @@
 import org.apache.directory.server.ntp.NtpServer;
 import org.apache.directory.server.protocol.shared.LoadStrategy;
 import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
+import org.apache.directory.server.ssl.LdapsInitializer;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
@@ -415,32 +415,8 @@
             return;
         }
 
-        // We use the reflection API in case this is not running on JDK 1.5+.
-        IoFilterChainBuilder chain;
-        try
-        {
-            chain = ( IoFilterChainBuilder ) Class.forName( "org.apache.directory.server.ssl.LdapsInitializer",
true,
-                ServerContextFactory.class.getClassLoader() ).getMethod( "init", new Class[]
-                { ServerStartupConfiguration.class } ).invoke( null, new Object[]
-                { cfg } );
-            ldapsStarted = true;
-        }
-        catch ( InvocationTargetException e )
-        {
-            if ( e.getCause() instanceof NamingException )
-            {
-                throw ( NamingException ) e.getCause();
-            }
-            else
-            {
-                throw ( NamingException ) new NamingException( "Failed to load LDAPS initializer."
).initCause( e
-                    .getCause() );
-            }
-        }
-        catch ( Exception e )
-        {
-            throw ( NamingException ) new NamingException( "Failed to load LDAPS initializer."
).initCause( e );
-        }
+        IoFilterChainBuilder chain = LdapsInitializer.init( cfg );
+        ldapsStarted = true;
 
         startLDAP0( cfg, env, cfg.getLdapsPort(), chain );
     }



Mime
View raw message