|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.slide.common.Domain
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.
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:
After initialization is complete, the client application can request access to the domain. It uses one of the two methods:
Domain.accessNamespace(SecurityToken
securityObject, String namespace)
NamespaceAccessToken
, which thereafter must be used by
the client application to perform operations on the namespace.
Domain.accessDomain(SecurityToken
securityObject)
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.
Constructor Summary | |
Domain()
|
Method Summary | |
static DomainAccessToken |
accessDomain(SecurityToken token)
Access a Domain. |
static NamespaceAccessToken |
accessNamespace(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(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 Logger |
getLogger()
Get the Domain logger. |
(package private) static Namespace |
getNamespace(java.lang.String namespaceName)
Get a namespace. |
static void |
info(java.lang.Object data)
Info. |
static void |
init(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. |
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. |
(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(Logger logger)
Set the logger to be used by Slide. |
(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 |
|
Constructor Detail |
public Domain()
Method Detail |
public static boolean isInitialized()
public static void setInitialized(boolean initialized)
public static java.lang.String getDefaultNamespace()
public static NamespaceAccessToken accessNamespace(SecurityToken token, java.lang.String namespaceName)
token
- Entity which wants accessnamespaceName
- Name of the namespace on which access is requestedpublic static java.util.Enumeration enumerateNamespaces()
public static void closeNamespace(NamespaceAccessToken token)
token
- Namespace access tokenpublic static void closeNamespace(SecurityToken token, java.lang.String namespaceName)
token
- Entity which wants to close the namespacenamespaceName
- Name of the namespacepublic static DomainAccessToken accessDomain(SecurityToken token)
token
- Service who wants accesspublic static java.lang.String getDomainFileName()
public static void init(java.net.URL configurationURL) throws java.lang.Exception
configurationURL
- The file name to read the configurationpublic static void init(java.lang.String configurationFileName) throws java.lang.Exception
configurationInputStream
- The file name to read the configurationpublic static void init(java.io.InputStream configurationInputStream) throws java.lang.Exception
configurationInputStream
- The file name to read the configurationpublic static void init(Configuration configuration)
configuration
- Avalon configuration objectpublic static void log(java.lang.Object data, java.lang.String channel, int level)
data
- The object to log.channel
- The channel name used for logging.level
- The level used for logging.public static void log(java.lang.Object data, int level)
data
- The object to log.level
- The level used for logging.public static void log(java.lang.Object data)
data
- The object to log.public static void debug(java.lang.Object data)
data
- The object to logpublic static void error(java.lang.Object data)
data
- The object to logpublic static void error(java.lang.Object data, java.lang.Throwable t)
data
- The object to logt
- Throwable objectpublic static void info(java.lang.Object data)
data
- The object to logpublic static void warn(java.lang.Object data)
data
- The object to logpublic static boolean isEnabled(java.lang.String channel, int level)
channel
- The channel specificationlevel
- The level specificationpublic static boolean isEnabled(int level)
level
- The level specificationpublic static boolean isDebugEnabled()
public static boolean isWarningEnabled()
public static boolean isInfoEnabled()
public static boolean isErrorEnabled()
static void setDomain(EmbeddedDomain domain)
static void start() throws java.lang.Exception
static void stop() throws java.lang.Exception
static void addNamespace(Namespace namespace)
namespace
- Namespace to be addedstatic Namespace getNamespace(java.lang.String namespaceName)
namespaceName
- Name of the namespacestatic void setLogger(Logger logger)
logger
- Logger the domain will usestatic Logger getLogger()
static void selfInit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |