directory-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=438383&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/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java?rev=438383&r1=438382&r2=438383&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java
(original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java
Tue Aug 29 23:03:05 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