|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
RASIHandler
defines the methods that must be implemented
to process RASEvents
generated by a
RASLogger
.
Method Summary | |
---|---|
void |
addFormatter(RASIFormatter formatter)
Registers a RAS event formatter with this handler. |
void |
closeDevice()
Closes the device to which the handler is sending its log entries, if it is open. |
java.util.Hashtable |
getConfig()
Gets the configuration of this object. |
java.util.Enumeration |
getFormatters()
Gets the set of formatters associated with this handler. |
int |
getMaximumQueueSize()
Gets the maximum number of RASIEvents which the
handler will hold. |
int |
getQueueSize()
Gets the current number of RASIEvents in the handler's
queue. |
int |
getRetryInterval()
Gets the amount of time (in milliseconds) that this handler will wait before retrying a failed write. |
void |
logEvent(RASIEvent event)
Passes a RAS event asynchronously from a logger to a handler. |
void |
openDevice()
Opens the device to which the handler will send its log entries. |
void |
removeFormatter(RASIFormatter formatter)
Removes a RAS event formatter from this handler. |
void |
setConfig(java.util.Hashtable ht)
Sets the configuration of this object. |
void |
setMaximumQueueSize(int size)
Sets the maximum number of RASIEvents which the handler
will hold. |
void |
setRetryInterval(int interval)
Sets the amount of time (in milliseconds) that this handler will wait before retrying a failed write. |
void |
stop()
Stops the handler. |
void |
writeEvent(RASIEvent event)
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 |
public java.util.Hashtable getConfig()
getConfig
in interface RASIMaskChangeGenerator
Hashtable
containing the configuration.
This object inserts the following key/value pairs into the
the configuration:
RASIEvents
which
this handler will hold.
All values are Strings
.
Extensions to this object may add additional keys.
public void setConfig(java.util.Hashtable ht)
RASManager
to initialize a RAS object.
It should not be necessary for an application to use this method.setConfig
in interface RASIMaskChangeGenerator
ht
- A Hashtable
containing the configuration.
This object searches for the following keys:
RASIEvents
which
this handler will hold.
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.
public int getMaximumQueueSize()
RASIEvents
which the
handler will hold. If not set, the default value of 10,000 is returned.public void setMaximumQueueSize(int size) throws java.lang.IllegalStateException
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.size
- The maximum queue size.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.public int getRetryInterval()
public void setRetryInterval(int interval)
interval
- The retry interval.public int getQueueSize()
RASIEvents
in the handler's
queue.public void addFormatter(RASIFormatter formatter)
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.formatter
- The event formatter.public void removeFormatter(RASIFormatter formatter)
null
or is not registered, this
method does nothing.formatter
- The event formatter.public java.util.Enumeration getFormatters()
Enumeration
of registered formatters. If no
formatters have been registered, the Enumeration
is empty.public void openDevice()
System.err
.
If the device is already open, it will be closed and then reopened.
public void closeDevice()
public void stop()
public void logEvent(RASIEvent event)
null
,
this method does nothing.event
- A RAS event.public void writeEvent(RASIEvent event)
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.event
- A RAS event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |