L
- The speficic BasicContextualLogger
implementation the domain will work with.public final class LogDomain<L extends BasicContextualLogger>
extends java.lang.Object
implements java.io.Serializable
Defines a logging domain, establishing a ADFContext-scoped namespace for loggers sharing one common root logger.
For example, if a logging domain is created having "oracle.adf" as the name of its root logger, then only the root logger itself or loggers whose names qualify subloggers (or subpackages) of "oracle.adf", such as "oracle.adf.model" or "oracle.adf.share.logging", will be allowed to join the domain.
Member loggers are never associated directly with a logging domain. This must be done through logger providers instead.
Constructor and Description |
---|
LogDomain(java.lang.String name,
LoggerProvider<L> root)
Creates a domain without any component name that can exist only in a
ADFContext's request scope.
|
LogDomain(java.lang.String name,
LoggerProvider<L> root,
java.lang.String scopeName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(LoggerProvider provider)
Check if a logger provider belongs to the domain.
|
boolean |
contains(java.lang.String loggerName)
Check if a logger name is in the namespace defined by the domain's
root logger.
|
boolean |
equals(java.lang.Object obj)
2 domains will be considered to be equal if and only if all conditions
bellow are true:
their names are identical
their root logger providers are identical
their scope names are identical
|
LoggerProvider<L> |
getDefaultLoggerProvider()
This method will return either the domain's root logger provider or the
latest logger provider set via
setDefaultLoggerProvider(oracle.adfinternal.model.logging.contextual.LoggerProvider<L>) , unless
this was set to null, in which case the root logger will also be returned. |
java.lang.String |
getName()
Get the name of the logging domain
|
LoggerProvider<L> |
getRootLoggerProvider()
Retrive the root logger provider for this domain
|
java.lang.String |
getScopeName()
Name of the ADFContext's scope where the logging domain will exist
|
int |
hashCode() |
void |
setDefaultLoggerProvider(LoggerProvider<L> provider)
Set a default logger provider for the domain.
|
java.lang.String |
toString()
Will return the domain's name
|
public LogDomain(java.lang.String name, LoggerProvider<L> root)
Creates a domain without any component name that can exist only in a ADFContext's request scope.
name
- The domain's nameroot
- The root logger provider defining the namespace for the domainpublic LogDomain(java.lang.String name, LoggerProvider<L> root, java.lang.String scopeName)
Constructor.
name
- The domain's nameroot
- The root logger provider defining the namespace for the domainscopeName
- The name of a valid scope within ADFContext where the
domain will existpublic java.lang.String getName()
public java.lang.String getScopeName()
public LoggerProvider<L> getRootLoggerProvider()
public LoggerProvider<L> getDefaultLoggerProvider()
setDefaultLoggerProvider(oracle.adfinternal.model.logging.contextual.LoggerProvider<L>)
, unless
this was set to null, in which case the root logger will also be returned.
Therefore, it is safe to assume that this method should never return null.setDefaultLoggerProvider(oracle.adfinternal.model.logging.contextual.LoggerProvider<L>)
.
The domain's root logger provider will be returned if no other is currently
set as default.public void setDefaultLoggerProvider(LoggerProvider<L> provider)
Having a default logger provider set guarantees that the
ContextualLoggingManager managing the domain will use this provider
to implicitly open a new logger and set it as current if method
ContextualLoggingManager.openLogger(oracle.adfinternal.model.logging.contextual.LoggerProvider<L>)
is called and the internal
logger stack is empty.
provider
- The provider to be set as default for the domainpublic boolean contains(java.lang.String loggerName)
loggerName
- The logger name to validatepublic boolean contains(LoggerProvider provider)
provider
- The logger provider to validatepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object