remm 01/06/20 11:18:14
Modified: src/share/org/apache/slide/common Domain.java
Log:
- Add a way to disable auto init of a namespace. It will be useful to do a cleaner
integration with Catalina.
Revision Changes Path
1.24 +29 -6 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.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Domain.java 2001/06/13 17:44:10 1.23
+++ Domain.java 2001/06/20 18:18:13 1.24
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
1.23 2001/06/13 17:44:10 remm Exp $
- * $Revision: 1.23 $
- * $Date: 2001/06/13 17:44:10 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
1.24 2001/06/20 18:18:13 remm Exp $
+ * $Revision: 1.24 $
+ * $Date: 2001/06/20 18:18:13 $
*
* ====================================================================
*
@@ -78,6 +78,7 @@
import org.apache.slide.authenticate.SecurityToken;
import org.apache.slide.util.conf.*;
import org.apache.slide.util.logger.Logger;
+import org.apache.slide.util.logger.SimpleLogger;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.*;
@@ -89,7 +90,7 @@
* For now, does not implement access control on Namespaces.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
- * @version $Revision: 1.23 $
+ * @version $Revision: 1.24 $
*/
public final class Domain {
@@ -137,6 +138,28 @@
/**
+ * Set the domain as having been initialized before.
+ */
+ public static void setInitialized(boolean initialized) {
+
+ if (!initialized)
+ return;
+
+ if (isInitialized())
+ return;
+
+ if (logger == null) {
+ logger = new org.apache.slide.util.logger.SimpleLogger();
+ logger.setLoggerLevel(Logger.INFO);
+ }
+
+ namespaces = new Hashtable();
+ activeNamespaces = new Hashtable();
+
+ }
+
+
+ /**
* Return the default namespace of this domain.
*
* @return the name of the default namespace
@@ -282,8 +305,8 @@
SAXParser parser = factory.newSAXParser();
Populate pop = new Populate();
Configuration slideConfiguration =
- new ConfigurationElement(pop.load(new
InputSource(configurationInputStream),
- parser.getParser()));
+ new ConfigurationElement(pop.load(new InputSource
+ (configurationInputStream), parser.getParser()));
Domain.init(slideConfiguration);