com.ibm.ras
Interface RASIHandler
-
- All Superinterfaces:
- RASIMaskChangeGenerator, RASIObject, java.io.Serializable
- All Known Implementing Classes:
- WsHandler
Deprecated.As of WAS 6.0, recommend using java.util.logging
public interface RASIHandler extends RASIMaskChangeGenerator
-
-
Method Summary
Methods Modifier and Type Method and Description void
addFormatter(RASIFormatter formatter)
Deprecated.Registers a RAS event formatter with this handler.void
closeDevice()
Deprecated.Closes the device to which the handler is sending its log entries, if it is open.java.util.Hashtable
getConfig()
Deprecated.Gets the configuration of this object.java.util.Enumeration
getFormatters()
Deprecated.Gets the set of formatters associated with this handler.int
getMaximumQueueSize()
Deprecated.Gets the maximum number ofRASIEvents
which the handler will hold.int
getQueueSize()
Deprecated.Gets the current number ofRASIEvents
in the handler's queue.int
getRetryInterval()
Deprecated.Gets the amount of time (in milliseconds) that this handler will wait before retrying a failed write.void
logEvent(RASIEvent event)
Deprecated.Passes a RAS event asynchronously from a logger to a handler.void
openDevice()
Deprecated.Opens the device to which the handler will send its log entries.void
removeFormatter(RASIFormatter formatter)
Deprecated.Removes a RAS event formatter from this handler.void
setConfig(java.util.Hashtable ht)
Deprecated.Sets the configuration of this object.void
setMaximumQueueSize(int size)
Deprecated.Sets the maximum number ofRASIEvents
which the handler will hold.void
setRetryInterval(int interval)
Deprecated.Sets the amount of time (in milliseconds) that this handler will wait before retrying a failed write.void
stop()
Deprecated.Stops the handler.void
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 interfaceRASIMaskChangeGenerator
- Specified by:
getConfig
in interfaceRASIObject
- 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 aRASManager
to initialize a RAS object. It should not be necessary for an application to use this method.- Specified by:
setConfig
in interfaceRASIMaskChangeGenerator
- Specified by:
setConfig
in interfaceRASIObject
- Parameters:
ht
- AHashtable
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 ofRASIEvents
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 ofRASIEvents
which the handler will hold. If this maximum is exceeded, objects which calllogEvent
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 ofRASIEvents
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 ofRASIEvent
classes which it supports before this method is called. If the formatter isnull
, 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 isnull
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, theEnumeration
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 toSystem.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 isnull
, 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 theformat
method of the configured formatter and then theprintln
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 isnull
, this method does nothing.- Parameters:
event
- A RAS event.
-
-