com.ibm.ras
Interface RASIHandler
All Superinterfaces:
RASIMaskChangeGenerator, RASIObject, java.io.Serializable
All known implementing classes:
Deprecated. As of WAS 6.0, recommend using java.util.logging
- public interface RASIHandler
- extends RASIMaskChangeGenerator
RASIHandler
defines the methods that must be implemented
to process RASEvents
generated by a
RASLogger
.
Method Summary
Modifier and Type | Method and Description |
---|---|
|
addFormatter(RASIFormatter formatter)
Deprecated. Registers a RAS event formatter with this handler.
|
|
closeDevice()
Deprecated. Closes the device to which the handler is sending its log entries, if
it is open.
|
|
getConfig()
Deprecated. Gets the configuration of this object.
|
|
getFormatters()
Deprecated. Gets the set of formatters associated with this handler.
|
|
getMaximumQueueSize()
Deprecated. Gets the maximum number of
RASIEvents which the
handler will hold.
|
|
getQueueSize()
Deprecated. Gets the current number of
RASIEvents in the handler's
queue.
|
|
getRetryInterval()
Deprecated. Gets the amount of time (in milliseconds) that this handler will wait
before retrying a failed write.
|
|
logEvent(RASIEvent event)
Deprecated. Passes a RAS event asynchronously from a logger to a handler.
|
|
openDevice()
Deprecated. Opens the device to which the handler will send its log entries.
|
|
removeFormatter(RASIFormatter formatter)
Deprecated. Removes a RAS event formatter from this handler.
|
|
setConfig(java.util.Hashtable ht)
Deprecated. Sets the configuration of this object.
|
|
setMaximumQueueSize(int size)
Deprecated. Sets the maximum number of
RASIEvents which the handler
will hold.
|
|
setRetryInterval(int interval)
Deprecated. Sets the amount of time (in milliseconds) that this handler will wait
before retrying a failed write.
|
|
stop()
Deprecated. Stops the handler.
|
|
writeEvent(RASIEvent event)
Deprecated. Passes a RAS event synchronously from a logger to a handler.
|
Methods inherited from interface com.ibm.ras.RASIMaskChangeGenerator |
---|
addMaskChangeListener, addMessageEventClass, addTraceEventClass, fireMaskChangedEvent, getMaskChangeListeners, getMessageEventClasses, getMessageMask, getTraceEventClasses, getTraceMask, removeMaskChangeListener, removeMessageEventClass, removeTraceEventClass, setMessageMask, setTraceMask |
Methods inherited from interface com.ibm.ras.RASIObject |
---|
getDescription, getGroup, getName, setDescription, setName |
Method Detail
getConfig
- java.util.Hashtable getConfig()
Deprecated.
Gets the configuration of this object.
Specified by:
getConfig
in interface RASIMaskChangeGenerator
Specified by:
getConfig
in interface RASIObject
Returns:
A
Hashtable
containing the configuration.
This object inserts the following key/value pairs into the
the configuration:
- maxQueueSize
- The maximum number of
RASIEvents
which this handler will hold. - retryInterval
- The number of milliseconds that this handler will wait before retrying a failed write.
- formatterNames
- The names of the formatters attached to this handler.
All values are Strings
.
Extensions to this object may add additional keys.
setConfig
- void setConfig(java.util.Hashtable ht)
Deprecated.
Sets the configuration of this object. This method is used by a
RASManager
to initialize a RAS object.
It should not be necessary for an application to use this method.
Specified by:
setConfig
in interface RASIMaskChangeGenerator
Specified by:
setConfig
in interface RASIObject
Parameters:
ht
- A Hashtable
containing the configuration.
This object searches for the following keys:
- maxQueueSize
- The maximum number of
RASIEvents
which this handler will hold. - retryInterval
- The number of milliseconds that this handler will wait before retrying a failed write.
- formatterNames
- The names of the formatters attached to this handler.
All values are Strings
.
If a key is not found, an internal default for that element
is set instead.
Extensions to this object may add additional keys.
getMaximumQueueSize
- int getMaximumQueueSize()
Deprecated.
Gets the maximum number of
RASIEvents
which the
handler will hold. If not set, the default value of 10,000 is returned.
Returns:
The maximum queue size.
setMaximumQueueSize
- void setMaximumQueueSize(int size)
- throws java.lang.IllegalStateException
Deprecated.
Sets the maximum number of
RASIEvents
which the handler
will hold. If this maximum is exceeded, objects which call
logEvent
will be throttled-back, until the queue has
enough space for the new object. If the size is set to zero, no
maximum is in effect. If the size is less than zero, the current
value is not changed.
Parameters:
size
- The maximum queue size. Throws:
java.lang.IllegalStateException
- This exception is thrown if any RAS events are on the queue when an
attempt is made to change the queue's size. getRetryInterval
- int getRetryInterval()
Deprecated.
Gets the amount of time (in milliseconds) that this handler will wait
before retrying a failed write.
If not set, the default value of 5000 (five seconds) is returned.
Returns:
The retry interval.
setRetryInterval
- void setRetryInterval(int interval)
Deprecated.
Sets the amount of time (in milliseconds) that this handler will wait
before retrying a failed write.
If the size is set to zero, no delay is in effect and the retry occurs
immediately. If the interval is less than zero, the current value is not
changed.
Parameters:
interval
- The retry interval. getQueueSize
- int getQueueSize()
Deprecated.
Gets the current number of
RASIEvents
in the handler's
queue.
Returns:
The current queue size.
addFormatter
- void addFormatter(RASIFormatter formatter)
Deprecated.
Registers a RAS event formatter with this handler. The formatter
must be configured with the set of
RASIEvent
classes
which it supports before this method is called.
If the formatter is null
, this method does nothing.
If the formatter supports an event class which is already registered
with this handler, this new formatter replaces the old one.
Parameters:
formatter
- The event formatter. removeFormatter
- void removeFormatter(RASIFormatter formatter)
Deprecated.
Removes a RAS event formatter from this handler.
If the formatter is
null
or is not registered, this
method does nothing.
Parameters:
formatter
- The event formatter. getFormatters
- java.util.Enumeration getFormatters( )
Deprecated.
Gets the set of formatters associated with this handler.
Returns:
An
Enumeration
of registered formatters. If no
formatters have been registered, the Enumeration
is empty. openDevice
- void openDevice()
Deprecated.
Opens the device to which the handler will send its log entries.
If an error occurs during this process, the handler will write a
message to
System.err
.
If the device is already open, it will be closed and then reopened.
closeDevice
- void closeDevice()
Deprecated.
Closes the device to which the handler is sending its log entries, if
it is open.
stop
- void stop()
Deprecated.
Stops the handler. This method should be called when a handler is
no longer needed. Be careful not to stop a handler prematurely if it
is shared by more than one logger.
logEvent
- void logEvent(RASIEvent event)
Deprecated.
Passes a RAS event asynchronously from a logger to a handler.
The log entry is saved for processing by the handler. The logger
must compare the message type against the handler's message
mask before calling this method. If the log event is
null
,
this method does nothing.
Parameters:
event
- A RAS event. writeEvent
- void writeEvent(RASIEvent event)
Deprecated.
Passes a RAS event synchronously from a logger to a handler.
The handler processes the log entry immediately by calling the
format
method of the configured formatter and then the
println
method of the configured print writer.
The logger must compare the event type against the handler's message
or trace mask before calling this method. If the log event is
null
, this method does nothing.
Parameters:
event
- A RAS event.