|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.ras.mgr.RASManager
public class RASManager
RASManager
is a manager of RAS objects. It is an
additional feature to the RAS Toolkit. That is, an application
can use the RAS Tookit without a RAS Manager by creating
all of the required toolkit objects in an application. This may be
suitable for "smaller" applications in which the trace state and output
device can be hard-coded, or passed to the application when it starts.
In more complex environments, an application can be written to use a
RAS Manager to acquire its RASLoggers
. This generally
lightens the load on the application programmer.
The RAS Manager can also provide RAS configuration information to a graphical program, which would allow an end-user or administrator to reconfigure the RAS system -- turning specific loggers on or off, for example.
The RAS Manager deals primarily in configuration data. That is, it must be told which RAS objects it can create, what their options are and how they are connected. When an object, such as a message logger, is requested by an application, the RAS Manager creates it from its configuration data and returns the object. Only one instance of a RAS object is created. This allows different applications, or components of a single application, to share RAS objects.
The RAS Manager configuration is organized as one or more "groups." Groups are a way for an application to distinguish its loggers and handlers from others that may be controlled by the RAS Manager. It is recommended that each application organize its loggers into one or more RAS groups. Handlers are usually considered to be system-wide resources and are, therfore, typically contained in the "base group."
This base group can also contain other groups. The RAS Manager thus implements a "flat tree" of groups. That is, groups may only be added to the base group. An application can impose a logical structure of groups within groups by carefully selecting group names. One way to do this is to use a naming scheme similar to Java package names. This would be very useful to a graphical program that wished to display RAS configurations to an end-user.
An application normally only uses the getMessageLogger
and getTraceLogger
methods. The RAS Manager will attach
to the logger any handlers which are included in the logger's
configuration and any formatters which are included in the handler's
configuration. The RAS Manager will search the group containing the
logger and then the base group for the handler configuration
information. If no handlers are included in the logger's
configuration, the RAS Manager will use the set of default handlers.
Formatter configurations are searched for in the same manner as
handler configurations.
In some environments, a RAS Manager may be able to get its
initial configuration from persistent storage (such as a properties
file or an LDAP database) and, possibly, save it there as well. This
medium is represented by the RASIDataStore
interface, whose
restoreConfig
and
saveConfig
methods
provide this function. Two examples of a RASIDataStore
are
provided in this package:
RASDefaultDataStore
assumes that no
persistent store is available. The restoreConfig
and
saveConfig
methods perform no function.
RASPropertyDataStore
gets its
configuration from a properties file of a specific format.
RASBaseGroup
and zero or more
RASGroups
and passing this to the
RAS Manager through the setBaseGroup
method.
However, the preferred approach is to use persistent storage.
Field Summary | |
---|---|
protected static java.lang.Object |
dsLock
Deprecated. An object on which the manager can synchronize for data store operations. |
protected static java.lang.Object |
getMgrLock
Deprecated. An object on which the manager can synchronize when getting the manager. |
protected static java.lang.Object |
getObjLock
Deprecated. An object on which the manager can synchronize when getting a RAS object such as a logger. |
Constructor Summary | |
---|---|
protected |
RASManager(RASIDataStore store)
Deprecated. Creates a RASManager . |
Method Summary | |
---|---|
void |
addDataStore(RASIDataStore store)
Deprecated. Adds a RASIDataStore to this manager. |
protected void |
addFormatters(RASIHandler handler,
RASConfig cfg,
RASGroup group)
Deprecated. Add formatters to a newly-created handler, according to the handler's configuration. |
protected void |
addHandlers(RASILogger logger,
RASConfig cfg,
RASGroup group)
Deprecated. Add handlers to a logger, according to the logger's configuration. |
protected void |
finalize()
Deprecated. Clean up resources in use before the garbage collector destroys this object. |
RASBaseGroup |
getBaseGroup()
Deprecated. Gets the entire RAS configuration. |
java.util.Enumeration |
getDataStores()
Deprecated. Gets the data store objects in use by this manager. |
RASIFormatter |
getFormatter(java.lang.String name)
Deprecated. Gets a formatter from the base group. |
RASIFormatter |
getFormatter(java.lang.String name,
RASGroup group)
Deprecated. Gets a formatter from a group. |
RASIFormatter |
getFormatter(java.lang.String name,
java.lang.String groupName)
Deprecated. Gets a formatter from the named group. |
RASIHandler |
getHandler(java.lang.String name)
Deprecated. Gets a handler from the base group. |
RASIHandler |
getHandler(java.lang.String name,
RASGroup group)
Deprecated. Gets a handler from a group. |
RASIHandler |
getHandler(java.lang.String name,
java.lang.String groupName)
Deprecated. Gets a handler from the named group. |
static RASManager |
getManager()
Deprecated. Gets the RASManager . |
static RASManager |
getManager(RASIDataStore store)
Deprecated. Gets the RASManager . |
RASIMessageLogger |
getMessageLogger(java.lang.String name)
Deprecated. Gets a message logger from the base group. |
RASIMessageLogger |
getMessageLogger(java.lang.String name,
RASGroup group)
Deprecated. Gets a message logger from a group. |
RASIMessageLogger |
getMessageLogger(java.lang.String name,
java.lang.String groupName)
Deprecated. Gets a message logger from the named group. |
protected RASObject |
getObject(RASConfig cfg)
Deprecated. Gets a RASObject from its configuration. |
RASITraceLogger |
getTraceLogger(java.lang.String name)
Deprecated. Gets a trace logger from the base group. |
RASITraceLogger |
getTraceLogger(java.lang.String name,
RASGroup group)
Deprecated. Gets a trace logger from a group. |
RASITraceLogger |
getTraceLogger(java.lang.String name,
java.lang.String groupName)
Deprecated. Gets a trace logger from the named group. |
void |
removeDataStore(RASIDataStore store)
Deprecated. Removes a RASIDataStore from this manager. |
protected void |
removeFormatters(RASIHandler handler,
RASGroup group)
Deprecated. Removes formatters from a handler. |
protected void |
removeHandlers(RASILogger logger,
RASGroup group)
Deprecated. Removes handlers from a logger. |
void |
restoreConfig()
Deprecated. Restores the RASManager configuration from persistent
storage. |
void |
returnFormatter(RASIFormatter formatter)
Deprecated. Returns a formatter to its group. |
void |
returnFormatter(RASIFormatter formatter,
RASGroup group)
Deprecated. Returns a formatter to a group. |
void |
returnFormatter(RASIFormatter formatter,
java.lang.String groupName)
Deprecated. Returns a formatter to the named group. |
void |
returnHandler(RASIHandler handler)
Deprecated. Returns a handler to its group. |
void |
returnHandler(RASIHandler handler,
RASGroup group)
Deprecated. Returns a handler to a group. |
void |
returnHandler(RASIHandler handler,
java.lang.String groupName)
Deprecated. Returns a handler to the named group. |
void |
returnMessageLogger(RASIMessageLogger logger)
Deprecated. Returns a message logger to its group. |
void |
returnMessageLogger(RASIMessageLogger logger,
RASGroup group)
Deprecated. Returns a message logger to a group. |
void |
returnMessageLogger(RASIMessageLogger logger,
java.lang.String groupName)
Deprecated. Returns a message logger to the named group. |
void |
returnTraceLogger(RASITraceLogger logger)
Deprecated. Returns a trace logger to its group. |
void |
returnTraceLogger(RASITraceLogger logger,
RASGroup group)
Deprecated. Returns a trace logger to a group. |
void |
returnTraceLogger(RASITraceLogger logger,
java.lang.String groupName)
Deprecated. Returns a trace logger to the named group. |
void |
saveConfig()
Deprecated. Saves the RASManager configuration to persistent
storage. |
void |
setBaseGroup(RASBaseGroup baseGroup)
Deprecated. Sets the entire RAS configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.Object dsLock
protected static final java.lang.Object getMgrLock
protected static final java.lang.Object getObjLock
Constructor Detail |
---|
protected RASManager(RASIDataStore store)
RASManager
. This method is protected to
force applications to use the factory method getManager
.
store
- An object which implements the
RASIDataStore
interface.Method Detail |
---|
public static RASManager getManager()
RASManager
. If the RAS Manager has already been
created through a previous call to getManager
, that
manager is returned. Otherwise, a new manager is created and returned.
A manager created with this method has no data store from which it
can read a configuration. The addDataStore
method
can be used to add a data store to an existing manager.
public static RASManager getManager(RASIDataStore store)
RASManager
. If the RAS Manager has already been
created through a previous call to getManager
, that
manager is returned. Otherwise, a new manager is created and returned.
store
- An object which implements the
RASIDataStore
interface.
public void addDataStore(RASIDataStore store)
RASIDataStore
to this manager. After adding
a data store, use restoreConfig
to restore the
configuration from the data store.
Only one data store is supported in this implementation. A new data store replaces the current store.
addDataStore
in interface RASIManager
store
- An object which implements the RASIDataStore
interface.public void removeDataStore(RASIDataStore store)
RASIDataStore
from this manager.
Only one data store is supported in this implementation. If the requested store is in use, it is removed. Otherwise, nothing is changed.
removeDataStore
in interface RASIManager
store
- An object which implements the RASIDataStore
interface.public java.util.Enumeration getDataStores()
Only one data store is supported in this implementation. It is
returned in a Vector
(to support future enhancements).
getDataStores
in interface RASIManager
Enumeration
of data stores.public void restoreConfig() throws RASIOException
RASManager
configuration from persistent
storage. If the RAS Manager has not been given a
RASIDataStore
to use, this method does nothing.
restoreConfig
in interface RASIManager
RASIOException
public void saveConfig() throws RASIOException
RASManager
configuration to persistent
storage. If the RAS Manager has not been given a
RASIDataStore
to use, this method does nothing.
saveConfig
in interface RASIManager
RASIOException
public RASIMessageLogger getMessageLogger(java.lang.String name)
If the logger configuration includes handlers, they will
automatically be attached to the logger. It should not be necessary
for an application to use the getHandler
method.
getMessageLogger
in interface RASIManager
name
- The name of the message logger.
null
if the requested
logger was not found.public RASIMessageLogger getMessageLogger(java.lang.String name, java.lang.String groupName)
If the logger configuration includes handlers, they will
automatically be attached to the logger. It should not be necessary
for an application to use the getHandler
method.
getMessageLogger
in interface RASIManager
name
- The name of the message logger.groupName
- The name of the RASGroup
.
null
if the requested
logger was not found.public RASIMessageLogger getMessageLogger(java.lang.String name, RASGroup group)
If the logger configuration includes handlers, they will
automatically be attached to the logger. It should not be necessary
for an application to use the getHandler
method.
getMessageLogger
in interface RASIManager
name
- The name of the message logger.group
- The RASGroup
.
null
if the requested
logger was not found.public void returnMessageLogger(RASIMessageLogger logger)
null
, this method does nothing.
If the logger configuration includes handlers, they will
automatically be detached from the logger. It should not be necessary
for an application to use the returnHandler
method.
returnMessageLogger
in interface RASIManager
logger
- The logger being returned.public void returnMessageLogger(RASIMessageLogger logger, java.lang.String groupName)
null
, this method does
nothing.
If the logger configuration includes handlers, they will
automatically be detached from the logger. It should not be necessary
for an application to use the returnHandler
method.
returnMessageLogger
in interface RASIManager
logger
- The logger being returned.groupName
- The name of the RASGroup
.public void returnMessageLogger(RASIMessageLogger logger, RASGroup group)
null
, this method does
nothing.
If the logger configuration includes handlers, they will
automatically be detached from the logger. It should not be necessary
for an application to use the returnHandler
method.
returnMessageLogger
in interface RASIManager
logger
- The logger being returned.group
- The RASGroup
.public RASITraceLogger getTraceLogger(java.lang.String name)
If the logger configuration includes handlers, they will
automatically be attached to the logger. It should not be necessary
for an application to use the getHandler
method.
getTraceLogger
in interface RASIManager
name
- The name of the trace logger.
null
if the requested
logger was not found.public RASITraceLogger getTraceLogger(java.lang.String name, java.lang.String groupName)
If the logger configuration includes handlers, they will
automatically be attached to the logger. It should not be necessary
for an application to use the getHandler
method.
getTraceLogger
in interface RASIManager
name
- The name of the trace logger.groupName
- The name of the RASGroup
.
null
if the requested
logger was not found.public RASITraceLogger getTraceLogger(java.lang.String name, RASGroup group)
If the logger configuration includes handlers, they will
automatically be attached to the logger. It should not be necessary
for an application to use the getHandler
method.
getTraceLogger
in interface RASIManager
name
- The name of the trace logger.group
- The RASGroup
.
null
if the requested
logger was not found.public void returnTraceLogger(RASITraceLogger logger)
null
, this method does nothing.
If the logger configuration includes handlers, they will
automatically be detached from the logger. It should not be necessary
for an application to use the returnHandler
method.
returnTraceLogger
in interface RASIManager
logger
- The logger being returned.public void returnTraceLogger(RASITraceLogger logger, java.lang.String groupName)
null
, this method does
nothing.
If the logger configuration includes handlers, they will
automatically be detached from the logger. It should not be necessary
for an application to use the returnHandler
method.
returnTraceLogger
in interface RASIManager
logger
- The logger being returned.groupName
- The name of the RASGroup
.public void returnTraceLogger(RASITraceLogger logger, RASGroup group)
null
, this method does
nothing.
If the logger configuration includes handlers, they will
automatically be detached from the logger. It should not be necessary
for an application to use the returnHandler
method.
returnTraceLogger
in interface RASIManager
logger
- The logger being returned.group
- The RASGroup
.public RASIHandler getHandler(java.lang.String name)
If the logger configuration includes handlers, they will
automatically be attached to the logger. It should not be necessary
for an application to use the getHandler
method.
getHandler
in interface RASIManager
name
- The name of the handler.
null
if the requested
handler was not found.public RASIHandler getHandler(java.lang.String name, java.lang.String groupName)
If the logger configuration includes handlers, they will
automatically be attached to the logger. It should not be necessary
for an application to use the getHandler
method.
getHandler
in interface RASIManager
name
- The name of the handler.groupName
- The name of the RASGroup
.
null
if the requested
handler was not found.public RASIHandler getHandler(java.lang.String name, RASGroup group)
If the logger configuration includes handlers, they will
automatically be attached to the logger. It should not be necessary
for an application to use the getHandler
method.
getHandler
in interface RASIManager
name
- The name of the handler.group
- The RASGroup
.
null
if the requested
handler was not found.public void returnHandler(RASIHandler handler)
null
, this method does nothing.
If the logger configuration includes handlers, they will
automatically be detached from the logger. It should not be necessary
for an application to use the returnHandler
method.
returnHandler
in interface RASIManager
handler
- The handler being returned.public void returnHandler(RASIHandler handler, java.lang.String groupName)
null
, this method does
nothing.
If the logger configuration includes handlers, they will
automatically be detached from the logger. It should not be necessary
for an application to use the returnHandler
method.
returnHandler
in interface RASIManager
handler
- The handler being returned.groupName
- The name of the RASGroup
.public void returnHandler(RASIHandler handler, RASGroup group)
null
, this method does
nothing.
If the logger configuration includes handlers, they will
automatically be detached from the logger. It should not be necessary
for an application to use the returnHandler
method.
returnHandler
in interface RASIManager
handler
- The handler being returned.group
- The RASGroup
.public RASIFormatter getFormatter(java.lang.String name)
If the handler configuration includes formatters, they will
automatically be attached to the handler. It should not be necessary
for an application to use the getFormatter
method.
getFormatter
in interface RASIManager
name
- The name of the formatter.
null
if the requested
formatter was not found.public RASIFormatter getFormatter(java.lang.String name, java.lang.String groupName)
If the handler configuration includes formatters, they will
automatically be attached to the handler. It should not be necessary
for an application to use the getFormatter
method.
getFormatter
in interface RASIManager
name
- The name of the formatter.groupName
- The name of the RASGroup
.
null
if the requested
formatter was not found.public RASIFormatter getFormatter(java.lang.String name, RASGroup group)
If the handler configuration includes formatters, they will
automatically be attached to the handler. It should not be necessary
for an application to use the getFormatter
method.
getFormatter
in interface RASIManager
name
- The name of the formatter.group
- The RASGroup
.
null
if the requested
formatter was not found.public void returnFormatter(RASIFormatter formatter)
null
, this method does nothing.
If the handler configuration includes formatters, they will
automatically be detached from the handler. It should not be necessary
for an application to use the returnFormatter
method.
returnFormatter
in interface RASIManager
formatter
- The formatter being returned.public void returnFormatter(RASIFormatter formatter, java.lang.String groupName)
null
, this method does
nothing.
If the handler configuration includes formatters, they will
automatically be detached from the handler. It should not be necessary
for an application to use the returnFormatter
method.
returnFormatter
in interface RASIManager
formatter
- The formatter being returned.groupName
- The name of the RASGroup
.public void returnFormatter(RASIFormatter formatter, RASGroup group)
null
, this method does
nothing.
If the handler configuration includes formatters, they will
automatically be detached from the handler. It should not be necessary
for an application to use the returnFormatter
method.
returnFormatter
in interface RASIManager
formatter
- The formatter being returned.group
- The RASGroup
.public RASBaseGroup getBaseGroup()
getBaseGroup
in interface RASIManager
public void setBaseGroup(RASBaseGroup baseGroup)
setBaseGroup
in interface RASIManager
baseGroup
- The base RAS group containing the entire configuration.protected RASObject getObject(RASConfig cfg)
RASObject
from its configuration. If the object
has been created already, it is returned. If not, a new object is
instantiated and returned.
cfg
- The configuration of the object.
null
if the requested
object was not found.protected void addHandlers(RASILogger logger, RASConfig cfg, RASGroup group)
logger
- The RAS logger.cfg
- The RAS logger configuration.group
- The RASGroup
in which the logger configuration
was found.protected void removeHandlers(RASILogger logger, RASGroup group)
logger
- The RAS logger.group
- The RASGroup
in which the logger
configuration was found.protected void addFormatters(RASIHandler handler, RASConfig cfg, RASGroup group)
handler
- The RAS handler.cfg
- The RAS handler configuration.group
- The RASGroup
in which the handler
configuration was found.protected void removeFormatters(RASIHandler handler, RASGroup group)
handler
- The RAS handler.group
- The RASGroup
in which the handler
configuration was found.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |