|
|||||||||
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
.
Within the RAS Toolkit, RASIHandler
is implemented by
the RASHandler
class.
Method Summary | |
void |
addFormatter(RASIFormatter formatter)
Registers a RAS event formatter with this handler. |
void |
addMaskChangeListener(RASIMaskChangeListener listener)
Adds an object that wishes to be informed of changes in the handler's message or trace mask configuration. |
java.util.Hashtable |
getConfig()
Gets the configuration of this object. |
java.util.Enumeration |
getFormatters()
Gets the set of formatters associated with this handler. |
java.util.Enumeration |
getMaskChangeListeners()
Gets the set of objects that wish to be informed of changes in the handler's message or trace mask configuration. |
long |
getMessageMask()
Gets the mask which defines the set of message types that will be processed. |
long |
getTraceMask()
Gets the mask which defines the set of trace types that will be processed. |
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 |
removeMaskChangeListener(RASIMaskChangeListener listener)
Removes an object from the list that wishes to be informed of changes in the handler's message or trace mask configuration. |
void |
setConfig(java.util.Hashtable ht)
Sets the configuration of this object. |
void |
setMessageMask(long mask)
Sets the mask which defines the set of message types that will be processed. |
void |
setTraceMask(long mask)
Sets the mask which defines the set of trace types that will be processed. |
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.RASIObject |
getDescription,
getName,
setDescription,
setName |
Method Detail |
public java.util.Hashtable getConfig()
Hashtable
containing the configuration.
This object inserts the following key/value pairs into the
the configuration:
"messageMask" The mask which selects the message types to be processed. "traceMask" The mask which selects the trace types to be processed.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.ht
- A Hashtable
containing the configuration.
This object searches for the following keys:
"messageMask" The mask which selects the message types to be processed. "traceMask" The mask which selects the trace types to be processed.All values are
Strings
.
If a key is not found, that configuration element is not
updated.
Extensions to this object may add additional keys.public long getMessageMask()
RASIMessageEvent.TYPE_XXXX
constants.public void setMessageMask(long mask)
RASIMessageEvent.TYPE_XXXX
constants.
The mask value is not validated against these types.mask
- The message mask.public long getTraceMask()
RASITraceEvent.TYPE_XXXX
constants.public void setTraceMask(long mask)
RASITraceEvent.TYPE_XXXX
constants.
The mask value is not validated against these types.mask
- The trace mask.public void addMaskChangeListener(RASIMaskChangeListener listener)
null
or is already registered, this method does nothing.listener
- The mask change listener.public void removeMaskChangeListener(RASIMaskChangeListener listener)
null
or is not registered, this method does
nothing.listener
- The mask change listener.public java.util.Enumeration getMaskChangeListeners()
Enumeration
of mask change listeners. If
no listeners are registered, the Enumeration
is empty.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 stop()
public void openDevice()
System.err
.
The caller should ensure that this method is not called if the device is already open or if cannot tolerate attempts to reopen it.
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 |