directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r438386 - /directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java
Date Wed, 30 Aug 2006 06:06:00 GMT
Author: akarasulu
Date: Tue Aug 29 23:06:00 2006
New Revision: 438386

URL: http://svn.apache.org/viewvc?rev=438386&view=rev
Log:
Fix for DIRSERVER-291: If configuration object is missing in env to startup server a default
StartupConfiguration can be presumed.

Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java?rev=438386&r1=438385&r2=438386&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java
Tue Aug 29 23:06:00 2006
@@ -49,15 +49,24 @@
 
     /**
      * Gets {@link Configuration} instance from the specified JNDI environment
-     * {@link Hashtable}.
+     * {@link Hashtable}.  If a configuration instance is not present the default
+     * StartupConfiguration is returned and injected into the environment.
      * 
      * @throws ConfigurationException if the specified environment doesn't
-     *                                contain the configuration instance.
+     *                                contain the proper configuration instance.
      */
     public static Configuration toConfiguration( Hashtable jndiEnvironment )
     {
         Object value = jndiEnvironment.get( JNDI_KEY );
-        if ( value == null || !( value instanceof Configuration ) )
+        
+        if ( value == null )
+        {
+            MutableStartupConfiguration msc = new MutableStartupConfiguration();
+            jndiEnvironment.put( JNDI_KEY, msc );
+            return msc;
+        }
+        
+        if ( !( value instanceof Configuration ) )
         {
             throw new ConfigurationException( "Not an ApacheDS configuration: " + value );
         }



Mime
View raw message