com.ibm.ras
Class RASMessageEvent
- java.lang.Object
com.ibm.ras.RASEvent
com.ibm.ras.RASMessageEvent
Deprecated. As of WAS 6.0, recommend using java.util.logging
- public class RASMessageEvent
- extends RASEvent
- implements RASIMessageEvent
RASMessageEvent
encapsulates all of the information generated
by a RASMessageLogger
. It is not necessary
to create a RASMessageEvent
directly, as the message logger
handles this task. However, the methods of this class are public, should
it be necessary to extend RASMessageEvent
.
A RASMessageEvent
contains the following components:
- A flag which identifies this event as a message event.
- A time stamp, generated when the message is created.
- A message type, such as informational, warning or error.
- The message text. If a message file is specified, this text is a "key" which selects the message text from the message file. (Separating the text from the classes which use it allows the text to be translated into different national languages.)
- A set of
Strings
which can be displayed with the message text. These parameters are required only if the message expects them. - A message file, which can be used to translate the message key to a text string. If this value is null, the text is displayed directly. (That is, it is not a key to be used with a message file.)
- A set of additional attributes that may be part of the event data.
The following attributes may be set. Unless otherwise noted, all
Objects
associated with the attributes areStrings
.- loggingClass
- The name of the Java class which generated the message.
- loggingMethod
- The name of the Java method which generated the message.
- organization
- The name of the organization which owns the application that created the message.
- product
- The name of the product that created the message.
- component
- The name of the component within the product that created the message.
- server
- A server associated with the creation of the message.
- client
- The client on whose behalf the message was created.
- exception
- A
Throwable
object.
Constants for these attributes are defined in the
RASConstants
class.
The RASMessageEvent
type is defined by the set of
RASIMessageEvent
TYPE_XXXX
constants.
Values 0x0000L up to, but not including, 0x01000L are reserved.
Extensions to the RASMessageEvent
class may use values outside
this range for additional types. The constant
RASIMessageEvent.DEFAULT_MESSAGE_MASK
contains the message types that the handlers log by default. It includes all
message types.
Field Summary
Fields inherited from interface com.ibm.ras.RASIMessageEvent |
---|
ALL_MESSAGE_MASK, DEFAULT_MESSAGE_MASK, TYPE_ERR, TYPE_ERROR, TYPE_INFO, TYPE_INFORMATION, TYPE_WARN, TYPE_WARNING |
Constructor Summary
Modifier | Constructor and Description |
---|---|
|
RASMessageEvent()
Deprecated. Creates a
RASMessageEvent .
|
|
RASMessageEvent(long type,java.lang.String text,java.lang.Object[] parms,java.lang.String messageFile)
Deprecated. Creates a
RASMessageEvent .
|
|
RASMessageEvent(long type,java.lang.String text,java.lang.Object[] parms,java.lang.String messageFile,java.lang.String loggingClass,java.lang.String loggingMethod,java.lang.String org,java.lang.String prod,java.lang.String comp,java.lang.String server,java.lang.String client,java.lang.Throwable exception)
Deprecated. Creates a
RASMessageEvent .
|
|
RASMessageEvent(long type,java.lang.String text,java.lang.String[] parms,java.lang.String messageFile)
Deprecated. Use
RASMessageEvent instead.
|
|
RASMessageEvent(long type,java.lang.String text,java.lang.String[] parms,java.lang.String messageFile,java.lang.String loggingClass,java.lang.String loggingMethod,java.lang.String org,java.lang.String prod,java.lang.String comp,java.lang.String server,java.lang.String client,java.lang.Throwable exception)
Deprecated. Use
RASMessageEvent instead.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
getMessageFile()
Deprecated. Gets the base message file name used to format a message.
|
|
getSupportedTypes()
Deprecated. Gets the complete set of event types supported by this class.
|
|
maskLongValue(java.lang.String types)
Deprecated. Converts a
String representation of a message or trace
mask to its long equivalent.
|
|
maskToString(long types)
Deprecated. Converts a long containing the logical OR of one or more event types
to its
String equivalent.
|
|
setMessageFile(java.lang.String messageFile)
Deprecated. Sets the base message file name used to format a message.
|
|
toString()
Deprecated. Returns a
String representation of this object.
|
Methods inherited from class com.ibm.ras.RASEvent |
---|
getAttribute, getParameters, getText, getTimeStamp, getType, isMessageEvent, objectsToStrings, setAttribute, setMessageEvent, setParameters, setText, setTimeStamp, setType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail
RASMessageEvent
- public RASMessageEvent()
RASMessageEvent
- protected RASMessageEvent(long type,
- java.lang.String text,
- java.lang.Object[] parms,
- java.lang.String messageFile)
RASMessageEvent
.
type
- The message type. text
- The message text, or a message key if the message file
is not null
. parms
- An array of Objects
to be displayed
with the message. messageFile
- The base message file name. RASMessageEvent
- protected RASMessageEvent(long type,
- java.lang.String text,
- java.lang.String[] parms,
- java.lang.String messageFile)
RASMessageEvent
instead.
RASMessageEvent
.
type
- The message type. text
- The message text, or a message key if the message file
is not null
. parms
- An array of Strings
to be displayed
with the message. messageFile
- The base message file name. RASMessageEvent
- public RASMessageEvent(long type,
- java.lang.String text,
- java.lang.Object[] parms,
- java.lang.String messageFile,
- java.lang.String loggingClass,
- java.lang.String loggingMethod,
- java.lang.String org,
- java.lang.String prod,
- java.lang.String comp,
- java.lang.String server,
- java.lang.String client,
- java.lang.Throwable exception)
RASMessageEvent
. The caller is expected to provide
a message type, key and, if needed, any Object
parameters for
the message text. If any of the other parameters are not needed, they
must be set to an empty string ("") or null
.
type
- The message type. text
- The message text, or a message key if the message file
is not null
. parms
- An array of Objects
to be displayed
with the message. messageFile
- The base message file name. loggingClass
- The class. loggingMethod
- The method. org
- The organization. prod
- The product. comp
- The component. server
- The server. client
- The client. exception
- A Throwable
object. RASMessageEvent
- public RASMessageEvent(long type,
- java.lang.String text,
- java.lang.String[] parms,
- java.lang.String messageFile,
- java.lang.String loggingClass,
- java.lang.String loggingMethod,
- java.lang.String org,
- java.lang.String prod,
- java.lang.String comp,
- java.lang.String server,
- java.lang.String client,
- java.lang.Throwable exception)
RASMessageEvent
instead.
RASMessageEvent
. The caller is expected to provide
a message type, key and, if needed, any Object
parameters for
the message text. If any of the other parameters are not needed, they
must be set to an empty string ("") or null
.
type
- The message type. text
- The message text, or a message key if the message file
is not null
. parms
- An array of Strings
to be displayed
with the message. messageFile
- The base message file name. loggingClass
- The class. loggingMethod
- The method. org
- The organization. prod
- The product. comp
- The component. server
- The server. client
- The client. exception
- A Throwable
object. Method Detail
getMessageFile
- public java.lang.String getMessageFile( )
setMessageFile
- public void setMessageFile(java.lang.String messageFile)
messageFile
- The message file name. getSupportedTypes
- public java.util.Hashtable getSupportedTypes( )
This method can be used by a graphical log manager to display the
set of types and allow a user to select those to be monitored. Every
extending class should override this method to add the types it supports
to the Hashtable
returned by its parent.
getSupportedTypes
in interface RASIEvent
getSupportedTypes
in class RASEvent
Hashtable
containing the values of all of the
event types. The names of the types are used as keys and
are returned in the current locale. The type values,
normally kept as longs
, are returned as
Longs
because of the Hashtable
requirement that all elements be Objects
. maskLongValue
- public long maskLongValue(java.lang.String types)
String
representation of a message or trace
mask to its long
equivalent. The string must have the
following format:
String types = "TYPE_INFO TYPE_WARN";Unknown values in the
String
are ignored.
types
- The blank-delimited String
to be converted. String
, formed by
the logical OR of each element in the String
. maskToString
- public java.lang.String maskToString( long types)
String
equivalent. The string will have the
following format:
String types = "TYPE_INFO TYPE_WARN";Every extending class should override this method to add the types it supports to the value returned by its parent.
Unknown values in the long
are ignored.
types
- The message or trace mask. String
equivalent of the mask. toString
- public java.lang.String toString( )
String
representation of this object.
toString
in class java.lang.Object
RASMessageEvent
.