com.ibm.websphere.ras
Class Manager

java.lang.Object
  |
  +--com.ibm.websphere.ras.Manager

public class Manager
extends java.lang.Object

The Manager is a WebSphere facility from which JRAS-compliant message and trace Loggers are obtained and through which the logical grouping of trace Loggers can be performed. It is the users interface with runtime services and Systems Management functionality. The Manager is a process singleton. Users must obtain a reference to this singleton Manager instance via the static "getManager()" method. When a user requests a named message or trace Logger from the Manager, the Manager will create it if necessary and then returns a reference to the caller. Only one instance of any named Logger is ever created (although both a message logger and a trace logger can be created with the same name). It is not recommended to create more than one Logger of a given type (message/trace) per class, but any logger can be shared among multiple classes. It is recommended that the fully qualified class name of the class instantiating the logger be used as the logger name to guarantee uniqueness among the name space. Groups are a convenience mechanism that can be used to build a functional trace across a variety of classes. Any trace Logger can be added to multiple groups, although this may lead to unpredictable side effects when more than one group is trace enabled at one time.


Constructor Summary
Manager()
          Deprecated.  
 
Method Summary
 void addLoggerToGroup(RASTraceLogger logger, java.lang.String groupName)
          Add a RASTraceLogger to a Group.
 RASMessageLogger createRASMessageLogger(java.lang.String component, java.lang.String name)
          FOR IBM INTERNAL USE ONLY Retrieve the specified RASMessageLogger, creating it if it doesn't already exist.
 RASMessageLogger createRASMessageLogger(java.lang.String organization, java.lang.String product, java.lang.String component, java.lang.String name)
          Retrieve the specified RASMessageLogger, creating it if it doesn't already exist.
 RASTraceLogger createRASTraceLogger(java.lang.String component, java.lang.String name)
          FOR IBM INTERNAL USE ONLY Retrieve the specified RASTraceLogger, creating it if it doesn't already exist.
 RASTraceLogger createRASTraceLogger(java.lang.String organization, java.lang.String product, java.lang.String component, java.lang.String name)
          Retrieve the specified RASTraceLogger, creating it if it doesn't already exist.
static Manager getManager()
          Return a reference to the singleton ManagerImpl instance for this process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Manager

public Manager()
Deprecated.  

Public default constructor WARNING: DO NOT USE THIS CONSTRUCTOR. It has been deprecated and will be removed.

Method Detail

getManager

public static Manager getManager()
Return a reference to the singleton ManagerImpl instance for this process. The singleton instance is atomically created if it doesn't already exist.

Returns:
A reference to the singleton ManagerImpl object.

createRASMessageLogger

public RASMessageLogger createRASMessageLogger(java.lang.String organization,
                                               java.lang.String product,
                                               java.lang.String component,
                                               java.lang.String name)
                                        throws java.lang.IllegalArgumentException
Retrieve the specified RASMessageLogger, creating it if it doesn't already exist. The returned RASMessageLogger is fully configured to log messages to the WebSphere runtime. By default, the RASMessageLogger returned from this call has its isLogging boolean set to true and its message mask set to RASIMessageEvent.DEFAULT_MESSAGE_MASK. The WebSphere runtime message types of Audit, Warning and Error will be enabled.

Parameters:
organization - The name of the organization. May not be null or empty String.
product - The name of the product. May not be null or empty String.
component - The name of the component. May not be null or empty String.
name - The name of the logger. May not be null or empty String.
Returns:
A reference to the requested Logger.
Throws:
java.lang.IllegalArgumentException - A passed String is either null or an empty string.

createRASMessageLogger

public RASMessageLogger createRASMessageLogger(java.lang.String component,
                                               java.lang.String name)
                                        throws java.lang.IllegalArgumentException
FOR IBM INTERNAL USE ONLY Retrieve the specified RASMessageLogger, creating it if it doesn't already exist. A Logger created via this method has the organization attribute set to IBM and the product attribute set to WebSphere. The returned RASMessageLogger is fully configured to log messages to the WebSphere runtime. By default, the RASMessageLogger returned from this call has its isLogging boolean set to true and its message mask set to RASIMessageEvent.DEFAULT_MESSAGE_MASK. The WebSphere runtime message types of Audit, Warning and Error will be enabled.

Parameters:
component - The name of the component. May not be null or empty String.
name - The name of the logger. May not be null or empty String.
Returns:
A reference to the requested Logger.
Throws:
java.lang.IllegalArgumentException - A passed String is either null or an empty string.

createRASTraceLogger

public RASTraceLogger createRASTraceLogger(java.lang.String organization,
                                           java.lang.String product,
                                           java.lang.String component,
                                           java.lang.String name)
                                    throws java.lang.IllegalArgumentException
Retrieve the specified RASTraceLogger, creating it if it doesn't already exist. Although RASTraceLoggers don't currently use organization, product or component information like the RASMessageLoggers do, we retain these items to maintain compatibility with existing interfaces. We may choose to utilize these in the future, so we retain our "valid parameters" requirement. The returned RASTraceLogger is fully configured with the trace mask set to the appropriate state. The default behavior is for the RASTraceLoggers isLogging boolean to be set to false and the trace mask set to zero. However, if a startup trace specification has been provided to WebSphere Systems Management that enables tracing for this logger, then that specification will be applied to this logger before it is returned.

Parameters:
organization - The name of the organization. May not be null or empty String.
product - The name of the product. May not be null or empty String.
component - The name of the component. May not be null or empty String.
name - The name of the logger. May not be null or empty String.
Returns:
A reference to the requested Logger.
Throws:
java.lang.IllegalArgumentException - A passed String is either null or an empty string.

createRASTraceLogger

public RASTraceLogger createRASTraceLogger(java.lang.String component,
                                           java.lang.String name)
                                    throws java.lang.IllegalArgumentException
FOR IBM INTERNAL USE ONLY Retrieve the specified RASTraceLogger, creating it if it doesn't already exist. Although RASTraceLoggers don't currently use organization, product or component information like the MessageLoggers do, we retain these items to maintain compatibility with existing interfaces. We may choose to utilize these in the future, so we retain our requirement that they are valid. The returned RASTraceLogger is fully configured with the trace mask set to the appropriate state. The default behavior is for the RASTraceLoggers isLogging boolean to be set to false and the trace mask set to zero. However, if a startup trace specification has been provided to WebSphere Systems Management that enables tracing for this logger, then that specification will be applied to this logger before it is returned.

Parameters:
component - The name of the component. May not be null or empty String.
name - The name of the logger. May not be null or empty String.
Returns:
A reference to the requested Logger.
Throws:
java.lang.IllegalArgumentException - A passed String is either null or an empty string.

addLoggerToGroup

public void addLoggerToGroup(RASTraceLogger logger,
                             java.lang.String groupName)
                      throws java.lang.IllegalArgumentException
Add a RASTraceLogger to a Group.

Parameters:
logger - A reference to the RASTraceLogger to add to the group. May not be null. The RASTraceLogger must have been obtained from this Manager.
groupName - The name of the group. May not be null or empty String
Throws:
java.lang.IllegalArgumentException - The specified logger is null or not a Logger. The specified group is null or an empty String.


 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.