Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.slide.common
Class Domain  view Domain download Domain.java

java.lang.Object
  extended byorg.apache.slide.common.Domain

public final class Domain
extends java.lang.Object

The Domain controls access to its registered namespaces and performs initialization and connection management on behalf of the namespaces.

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 Domain.accessNamespace().

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.

Initialization

When Slide is first initialized, the Domain configuration is loaded. The location of the domain configuration file is given through the org.apache.slide.domain property in the Slide properties, or can be specified as argument to the static Domain.init() method.

The domain configuration is written by an administrator and describes how each namespace is to be initialized. It includes information like:

Access and Security

After initialization is complete, the client application can request access to the domain. It uses one of the two methods:

The Domain uses an object (argument securityObject) to decide whether or not the client should be granted access. A good candidate is a reference to the client servlet or servlet context.

Note: Currently, access control on namespaces is not implemented.

Version:
$Revision: 1.48.2.1 $

Field Summary
private static java.util.Hashtable activeNamespaces
          Active namespaces hashtable.
private static java.lang.String defaultNamespace
          Default namespace.
private static EmbeddedDomain domain
          Compatibility with the new embedded domain.
private static java.lang.String domainFileName
          holds the expanded file name of domain.xml
private static java.lang.String LOG_CHANNEL
           
private static org.apache.slide.util.logger.Logger logger
          Slide logger.
private static java.util.Hashtable namespaces
          Namespaces hashtable.
private static boolean namespacesInitialized
           
private static java.util.Hashtable parameters
          Domain parameters
 
Constructor Summary
Domain()
           
 
Method Summary
static DomainAccessToken accessDomain(org.apache.slide.authenticate.SecurityToken token)
          Access a Domain.
static NamespaceAccessToken accessNamespace(org.apache.slide.authenticate.SecurityToken token, java.lang.String namespaceName)
          Access a Namespace.
(package private) static void addNamespace(Namespace namespace)
          Add a namespace to the domain.
static void closeNamespace(NamespaceAccessToken token)
          Close a namespace.
static void closeNamespace(org.apache.slide.authenticate.SecurityToken token, java.lang.String namespaceName)
          Clsose a namespace.
static void debug(java.lang.Object data)
          Debug.
static java.util.Enumeration enumerateNamespaces()
          Enumerate namespace names.
static void error(java.lang.Object data)
          Error.
static void error(java.lang.Object data, java.lang.Throwable t)
          Error.
static java.lang.String getDefaultNamespace()
          Return the default namespace of this domain.
static java.lang.String getDomainFileName()
          Access the file name of domain.xml.
(package private) static org.apache.slide.util.logger.Logger getLogger()
          Get the Domain logger.
(package private) static Namespace getNamespace(java.lang.String namespaceName)
          Get a namespace.
static java.lang.String getParameter(java.lang.String name)
          Get a domain parameter.
static java.lang.String getParameter(java.lang.String name, java.lang.String defaultValue)
          Get a domain parameter.
static java.lang.String getParameter(java.lang.String name, java.lang.String defaultValue, org.apache.slide.store.Store store)
          Get a domain parameter - possibly overlaid by a store specific value.
static void info(java.lang.Object data)
          Info.
static void init(org.apache.slide.util.conf.Configuration configuration)
          Domain initialization routine using Avalon configuration parser.
static void init(java.io.InputStream configurationInputStream)
          Domain initialization routine using Avalon configuration parser.
static void init(java.lang.String configurationFileName)
          Domain initialization routine using Avalon configuration parser.
static void init(java.net.URL configurationURL)
          Domain initialization routine using Avalon configuration parser.
private static void initNamespace(org.apache.slide.util.conf.Configuration configuration)
          Initializes a new namespace based on the given configuration data.
static boolean isDebugEnabled()
          Check if the default channel with the DEBUG level is enabled for logging.
static boolean isEnabled(int level)
          Check if the default channel with the specified level is enabled for logging.
static boolean isEnabled(java.lang.String channel, int level)
          Check if the channel with the specified level is enabled for logging.
static boolean isErrorEnabled()
          Check if the default channel with the ERROR level is enabled for logging.
static boolean isInfoEnabled()
          Check if the default channel with the INFO level is enabled for logging.
static boolean isInitialized()
          Tests if the domain has been initialized before.
static boolean isWarningEnabled()
          Check if the default channel with the WARNING level is enabled for logging.
static void log(java.lang.Object data)
          Log.
static void log(java.lang.Object data, int level)
          Log.
static void log(java.lang.Object data, java.lang.String channel, int level)
          Log.
static boolean namespacesAreInitialized()
          Return true, if all namespaces have been initialized.
(package private) static void selfInit()
          Default initialization of the domain.
(package private) static void setDomain(EmbeddedDomain domain)
          Set the embedded domain field.
static void setInitialized(boolean initialized)
          Set the domain as having been initialized before.
(package private) static void setLogger(org.apache.slide.util.logger.Logger logger)
          Set the logger to be used by Slide.
(package private) static void setParameters(java.util.Hashtable parameters)
          Set the specified parameters
(package private) static void start()
          Start domain (doesn't do anything yet).
(package private) static void stop()
          Stop domain.
static void warn(java.lang.Object data)
          Warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_CHANNEL

private static final java.lang.String LOG_CHANNEL

domain

private static EmbeddedDomain domain
Compatibility with the new embedded domain.


namespaces

private static java.util.Hashtable namespaces
Namespaces hashtable.


namespacesInitialized

private static boolean namespacesInitialized

activeNamespaces

private static java.util.Hashtable activeNamespaces
Active namespaces hashtable.


logger

private static org.apache.slide.util.logger.Logger logger
Slide logger.


defaultNamespace

private static java.lang.String defaultNamespace
Default namespace.


parameters

private static java.util.Hashtable parameters
Domain parameters


domainFileName

private static java.lang.String domainFileName
holds the expanded file name of domain.xml

Constructor Detail

Domain

public Domain()
Method Detail

isInitialized

public static boolean isInitialized()
Tests if the domain has been initialized before.


namespacesAreInitialized

public static boolean namespacesAreInitialized()
Return true, if all namespaces have been initialized.


setInitialized

public static void setInitialized(boolean initialized)
Set the domain as having been initialized before.


getDefaultNamespace

public static java.lang.String getDefaultNamespace()
Return the default namespace of this domain.


accessNamespace

public static NamespaceAccessToken accessNamespace(org.apache.slide.authenticate.SecurityToken token,
                                                   java.lang.String namespaceName)
Access a Namespace.


enumerateNamespaces

public static java.util.Enumeration enumerateNamespaces()
Enumerate namespace names.


closeNamespace

public static void closeNamespace(NamespaceAccessToken token)
Close a namespace.


closeNamespace

public static void closeNamespace(org.apache.slide.authenticate.SecurityToken token,
                                  java.lang.String namespaceName)
Clsose a namespace.


accessDomain

public static DomainAccessToken accessDomain(org.apache.slide.authenticate.SecurityToken token)
Access a Domain.


getDomainFileName

public static java.lang.String getDomainFileName()
Access the file name of domain.xml.


init

public static void init(java.net.URL configurationURL)
                 throws java.lang.Exception
Domain initialization routine using Avalon configuration parser.


init

public static void init(java.lang.String configurationFileName)
                 throws java.lang.Exception
Domain initialization routine using Avalon configuration parser.


init

public static void init(java.io.InputStream configurationInputStream)
                 throws java.lang.Exception
Domain initialization routine using Avalon configuration parser.


init

public static void init(org.apache.slide.util.conf.Configuration configuration)
Domain initialization routine using Avalon configuration parser.


log

public static void log(java.lang.Object data,
                       java.lang.String channel,
                       int level)
Log.


log

public static void log(java.lang.Object data,
                       int level)
Log.


log

public static void log(java.lang.Object data)
Log.


debug

public static void debug(java.lang.Object data)
Debug.


error

public static void error(java.lang.Object data)
Error.


error

public static void error(java.lang.Object data,
                         java.lang.Throwable t)
Error.


info

public static void info(java.lang.Object data)
Info.


warn

public static void warn(java.lang.Object data)
Warning.


isEnabled

public static boolean isEnabled(java.lang.String channel,
                                int level)
Check if the channel with the specified level is enabled for logging. This implementation ignores the channel specification


isEnabled

public static boolean isEnabled(int level)
Check if the default channel with the specified level is enabled for logging.


isDebugEnabled

public static boolean isDebugEnabled()
Check if the default channel with the DEBUG level is enabled for logging.


isWarningEnabled

public static boolean isWarningEnabled()
Check if the default channel with the WARNING level is enabled for logging.


isInfoEnabled

public static boolean isInfoEnabled()
Check if the default channel with the INFO level is enabled for logging.


isErrorEnabled

public static boolean isErrorEnabled()
Check if the default channel with the ERROR level is enabled for logging.


setDomain

static void setDomain(EmbeddedDomain domain)
Set the embedded domain field.


start

static void start()
           throws java.lang.Exception
Start domain (doesn't do anything yet).


stop

static void stop()
          throws java.lang.Exception
Stop domain.


addNamespace

static void addNamespace(Namespace namespace)
Add a namespace to the domain.


getNamespace

static Namespace getNamespace(java.lang.String namespaceName)
Get a namespace.


getParameter

public static java.lang.String getParameter(java.lang.String name)
Get a domain parameter.


getParameter

public static java.lang.String getParameter(java.lang.String name,
                                            java.lang.String defaultValue)
Get a domain parameter.


getParameter

public static java.lang.String getParameter(java.lang.String name,
                                            java.lang.String defaultValue,
                                            org.apache.slide.store.Store store)
Get a domain parameter - possibly overlaid by a store specific value.


setParameters

static void setParameters(java.util.Hashtable parameters)
Set the specified parameters


setLogger

static void setLogger(org.apache.slide.util.logger.Logger logger)
Set the logger to be used by Slide.


getLogger

static org.apache.slide.util.logger.Logger getLogger()
Get the Domain logger.


selfInit

static void selfInit()
Default initialization of the domain.


initNamespace

private static void initNamespace(org.apache.slide.util.conf.Configuration configuration)
Initializes a new namespace based on the given configuration data.