pnever 2002/09/10 04:21:52
Modified: src/share/org/apache/slide/common Domain.java
Log:
Fixed bug 12080 in setInitialized().
Revision Changes Path
1.37 +30 -31 jakarta-slide/src/share/org/apache/slide/common/Domain.java
Index: Domain.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- Domain.java 17 Jun 2002 14:58:21 -0000 1.36
+++ Domain.java 10 Sep 2002 11:21:52 -0000 1.37
@@ -85,33 +85,33 @@
import org.xml.sax.helpers.*;
/**
- * The Domain controls access to its registered namespaces and performs
+ * The Domain controls access to its registered namespaces and performs
* initialization and connection management on behalf of the namespaces.
- *
+ *
* <p>
- * From the client application's perspective, the domain represents the only
- * directly accessible object. It is through this object that the client
- * gains access to namespaces, using the static method
+ * From the client application's perspective, the domain represents the only
+ * directly accessible object. It is through this object that the client
+ * gains access to namespaces, using the static method
* <code>Domain.accessNamespace()</code>.
* <p/>
* <p>
- * Since the domain acts as the root of a directory service, it is a static
+ * Since the domain acts as the root of a directory service, it is a static
* entity and there can be only one domain per JVM.
* </p>
* <h3>Initialization</h3>
* <p>
- * When Slide is first initialized, the Domain configuration is loaded.
- * The location of the domain configuration file is given through the
- * <code>org.apache.slide.domain</code> property in the Slide properties, or
- * can be specified as argument to the static <code>Domain.init()</code>
+ * When Slide is first initialized, the Domain configuration is loaded.
+ * The location of the domain configuration file is given through the
+ * <code>org.apache.slide.domain</code> property in the Slide properties, or
+ * can be specified as argument to the static <code>Domain.init()</code>
* method.
* </p>
* <p>
- * The domain configuration is written by an administrator and describes how
+ * The domain configuration is written by an administrator and describes how
* each namespace is to be initialized. It includes information like:
* <ul>
* <li>
- * The low-level services the namespace uses (structure store, content
+ * The low-level services the namespace uses (structure store, content
* store, etc.)
* </li>
* <li>
@@ -122,35 +122,35 @@
* </p>
* <h3>Access and Security</h3>
* <p>
- * After initialization is complete, the client application can request
+ * After initialization is complete, the client application can request
* access to the domain. It uses one of the two methods:
* <ul>
* <li>
- * {@link #accessNamespace Domain.accessNamespace(SecurityToken
+ * {@link #accessNamespace Domain.accessNamespace(SecurityToken
securityObject, String namespace)}
* <br>
- * Used to access a specific namespace. This method returns a
- * <code>NamespaceAccessToken</code>, which thereafter must be used by
+ * Used to access a specific namespace. This method returns a
+ * <code>NamespaceAccessToken</code>, which thereafter must be used by
* the client application to perform operations on the namespace.
* <br><br>
* </li>
* <li>
- * {@link #accessDomain Domain.accessDomain(SecurityToken
+ * {@link #accessDomain Domain.accessDomain(SecurityToken
securityObject)}
* <br>
- * Enumerates the registered namespaces with this domain. This allows
+ * Enumerates the registered namespaces with this domain. This allows
* application to browse the list of available namespaces.
* </li>
* </ul>
* </p>
* <p>
- * The Domain uses an object (argument <code>securityObject</code>) to
- * decide whether or not the client should be granted access. A good
+ * The Domain uses an object (argument <code>securityObject</code>) to
+ * decide whether or not the client should be granted access. A good
* candidate is a reference to the client servlet or servlet context.<br><br>
- * <i><small>Note: Currently, access control on namespaces is not
+ * <i><small>Note: Currently, access control on namespaces is not
* implemented.</small></i>
* </p>
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
* @author Dirk Verbeeck
* @version $Revision$
@@ -228,6 +228,10 @@
* Set the domain as having been initialized before.
*/
public static void setInitialized(boolean initialized) {
+
+ if( namespaces == null ) namespaces = new Hashtable();
+ if( activeNamespaces == null ) activeNamespaces = new Hashtable();
+ if( parameters == null ) parameters = new Hashtable();
if (!initialized)
return;
@@ -241,11 +245,6 @@
}
namespacesInitialized = true;
-
- namespaces = new Hashtable();
- activeNamespaces = new Hashtable();
- parameters = new Hashtable();
-
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>