You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by re...@apache.org on 2001/06/10 07:46:29 UTC
cvs commit: jakarta-slide/src/share/org/apache/slide/common Domain.java
remm 01/06/09 22:46:29
Modified: src/share/org/apache/slide/common Domain.java
Log:
- Add a call to list the names of the namespaces in the domain.
Revision Changes Path
1.21 +34 -27 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.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- Domain.java 2001/04/09 14:41:22 1.20
+++ Domain.java 2001/06/10 05:46:29 1.21
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v 1.20 2001/04/09 14:41:22 juergen Exp $
- * $Revision: 1.20 $
- * $Date: 2001/04/09 14:41:22 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v 1.21 2001/06/10 05:46:29 remm Exp $
+ * $Revision: 1.21 $
+ * $Date: 2001/06/10 05:46:29 $
*
* ====================================================================
*
@@ -89,7 +89,7 @@
* For now, does not implement access control on Namespaces.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.20 $
+ * @version $Revision: 1.21 $
*/
public final class Domain {
@@ -153,6 +153,19 @@
/**
+ * List namespace names.
+ */
+ public static Enumeration listNamespaces() {
+
+ if (!isInitialized())
+ return (new Vector()).elements();
+
+ return (namespaces.keys());
+
+ }
+
+
+ /**
* Close a namespace.
*
* @param token Namespace access token
@@ -239,7 +252,9 @@
*
* @param configurationInputStream The file name to read the configuration
*/
- public static void init(InputStream configurationInputStream)throws Exception {
+ public static void init(InputStream configurationInputStream)
+ throws Exception {
+
if (isInitialized())
return;
@@ -257,9 +272,6 @@
}
-
-
-
/**
* Domain initialization routine using Avalon configuration parser.
*
@@ -411,59 +423,57 @@
* @param channel The channel specification
* @param level The level specification
*/
-
public static boolean isEnabled(String channel, int level) {
return logger.isEnabled(channel, level);
}
-
/**
- * Check if the default channel with the specified level is enabled for logging.
+ * Check if the default channel with the specified level is enabled for
+ * logging.
*
* @param level The level specification
*/
-
public static boolean isEnabled(int level) {
return logger.isEnabled(level);
}
/**
- * Check if the default channel with the DEBUG level is enabled for logging.
+ * Check if the default channel with the DEBUG level is enabled for
+ * logging.
*/
-
public static boolean isDebugEnabled() {
return isEnabled(logger.DEBUG);
}
+
/**
- * Check if the default channel with the WARNING level is enabled for logging.
+ * Check if the default channel with the WARNING level is enabled for
+ * logging.
*/
-
public static boolean isWarningEnabled() {
return isEnabled(logger.WARNING);
}
+
/**
* Check if the default channel with the INFO level is enabled for logging.
*/
-
public static boolean isInfoEnabled() {
return isEnabled(logger.INFO);
}
+
/**
- * Check if the default channel with the ERROR level is enabled for logging.
+ * Check if the default channel with the ERROR level is enabled for
+ * logging.
*/
-
public static boolean isErrorEnabled() {
return isEnabled(logger.ERROR);
}
-
-
// -------------------------------------------------------- Package Methods
@@ -472,9 +482,6 @@
*/
static void start()
throws Exception {
-
-
-
}
@@ -548,9 +555,9 @@
}
catch (Exception e) {
e.printStackTrace();
- throw new DomainInitializationFailedError("Logger Problem: " + e.toString());
+ throw new DomainInitializationFailedError
+ ("Logger Problem: " + e.toString());
}
-
}
info("Auto-Initializing Domain");
@@ -622,7 +629,7 @@
namespaceLogger =
(Logger) (Class.forName(loggerClass).newInstance());
namespaceLogger.setLoggerLevel(configuration.getAttributeAsInt
- ("logger-level", Logger.INFO));
+ ("logger-level", Logger.INFO));
} catch (Exception e) {
e.printStackTrace();
}