directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r279452 - in /directory/standalone/trunk/osgi: apacheds/src/main/java/org/apache/ldap/server/ jmx/src/main/java/org/apache/jmx/ ldap/src/main/java/org/apache/ldap/ loader/src/main/java/org/apache/ldap/server/loader/
Date Wed, 07 Sep 2005 22:48:51 GMT
Author: erodriguez
Date: Wed Sep  7 15:48:43 2005
New Revision: 279452

URL: http://svn.apache.org/viewcvs?rev=279452&view=rev
Log:
Minor refactoring in OSGi bundles:
o  replaced printstacktrace() with logging
o  replaced JNDI string keys with Context constants

Modified:
    directory/standalone/trunk/osgi/apacheds/src/main/java/org/apache/ldap/server/Activator.java
    directory/standalone/trunk/osgi/jmx/src/main/java/org/apache/jmx/JmxLogger.java
    directory/standalone/trunk/osgi/ldap/src/main/java/org/apache/ldap/Activator.java
    directory/standalone/trunk/osgi/loader/src/main/java/org/apache/ldap/server/loader/Activator.java

Modified: directory/standalone/trunk/osgi/apacheds/src/main/java/org/apache/ldap/server/Activator.java
URL: http://svn.apache.org/viewcvs/directory/standalone/trunk/osgi/apacheds/src/main/java/org/apache/ldap/server/Activator.java?rev=279452&r1=279451&r2=279452&view=diff
==============================================================================
--- directory/standalone/trunk/osgi/apacheds/src/main/java/org/apache/ldap/server/Activator.java
(original)
+++ directory/standalone/trunk/osgi/apacheds/src/main/java/org/apache/ldap/server/Activator.java
Wed Sep  7 15:48:43 2005
@@ -65,11 +65,11 @@
 
         Hashtable env = new Hashtable( setUpPartition() );
 
-        env.put( "java.naming.factory.initial", CoreContextFactory.class.getName() );
-        env.put( "java.naming.security.authentication", "simple" );
-        env.put( "java.naming.provider.url", "dc=example,dc=com" );
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", "secret" );
+        env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
+        env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
+        env.put( Context.SECURITY_CREDENTIALS, "secret" );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.CoreContextFactory"
);
 
         factory = new CoreContextFactory();
 
@@ -79,7 +79,7 @@
         }
         catch ( NamingException ne )
         {
-            ne.printStackTrace();
+            log.error( ne.getMessage(), ne );
             throw new BundleException( "Initial context load failed." );
         }
 
@@ -110,7 +110,7 @@
         }
         catch ( NamingException ne )
         {
-            ne.printStackTrace();
+            log.error( ne.getMessage(), ne );
             throw new BundleException( "Initial context shutdown failed." );
         }
 

Modified: directory/standalone/trunk/osgi/jmx/src/main/java/org/apache/jmx/JmxLogger.java
URL: http://svn.apache.org/viewcvs/directory/standalone/trunk/osgi/jmx/src/main/java/org/apache/jmx/JmxLogger.java?rev=279452&r1=279451&r2=279452&view=diff
==============================================================================
--- directory/standalone/trunk/osgi/jmx/src/main/java/org/apache/jmx/JmxLogger.java (original)
+++ directory/standalone/trunk/osgi/jmx/src/main/java/org/apache/jmx/JmxLogger.java Wed Sep
 7 15:48:43 2005
@@ -64,7 +64,7 @@
             }
             catch ( Exception e )
             {
-                e.printStackTrace();
+                log.error( e.getMessage(), e );
             }
         }
 

Modified: directory/standalone/trunk/osgi/ldap/src/main/java/org/apache/ldap/Activator.java
URL: http://svn.apache.org/viewcvs/directory/standalone/trunk/osgi/ldap/src/main/java/org/apache/ldap/Activator.java?rev=279452&r1=279451&r2=279452&view=diff
==============================================================================
--- directory/standalone/trunk/osgi/ldap/src/main/java/org/apache/ldap/Activator.java (original)
+++ directory/standalone/trunk/osgi/ldap/src/main/java/org/apache/ldap/Activator.java Wed
Sep  7 15:48:43 2005
@@ -20,6 +20,7 @@
 import java.util.Dictionary;
 import java.util.Hashtable;
 
+import javax.naming.Context;
 import javax.naming.spi.InitialContextFactory;
 
 import org.apache.ldap.server.configuration.StartupConfiguration;
@@ -144,11 +145,11 @@
 
     private void loadEnvironment( Hashtable env )
     {
-        env.put( "java.naming.provider.url", "ou=system" );
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.authentication", "simple" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.factory.initial", "org.apache.ldap.server.jndi.CoreContextFactory"
);
+        env.put( Context.PROVIDER_URL, "ou=system" );
+        env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
+        env.put( Context.SECURITY_CREDENTIALS, "secret" );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.CoreContextFactory"
);
 
         env.put( "asn.1.berlib.provider", "org.apache.ldap.common.berlib.asn1.SnickersProvider"
);
         env.put( "server.disable.anonymous", "true" );

Modified: directory/standalone/trunk/osgi/loader/src/main/java/org/apache/ldap/server/loader/Activator.java
URL: http://svn.apache.org/viewcvs/directory/standalone/trunk/osgi/loader/src/main/java/org/apache/ldap/server/loader/Activator.java?rev=279452&r1=279451&r2=279452&view=diff
==============================================================================
--- directory/standalone/trunk/osgi/loader/src/main/java/org/apache/ldap/server/loader/Activator.java
(original)
+++ directory/standalone/trunk/osgi/loader/src/main/java/org/apache/ldap/server/loader/Activator.java
Wed Sep  7 15:48:43 2005
@@ -21,6 +21,7 @@
 import java.util.Hashtable;
 import java.util.Properties;
 
+import javax.naming.Context;
 import javax.naming.NamingException;
 import javax.naming.ldap.LdapContext;
 import javax.naming.spi.InitialContextFactory;
@@ -112,10 +113,10 @@
 
     private void loadEnvironment( Hashtable env )
     {
-        env.put( "java.naming.provider.url", "dc=example,dc=com" );
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.authentication", "simple" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.factory.initial", "org.apache.ldap.server.jndi.CoreContextFactory"
);
+        env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
+        env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
+        env.put( Context.SECURITY_CREDENTIALS, "secret" );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.CoreContextFactory"
);
     }
 }



Mime
View raw message