Class RASMessageEvent
- java.lang.Object
-
- com.ibm.ras.RASEvent
-
- com.ibm.ras.RASMessageEvent
-
- All Implemented Interfaces:
- RASConstants, RASIEvent, RASIMessageEvent, java.io.Serializable
Deprecated.As of WAS 6.0, recommend using java.util.logging
public class RASMessageEvent extends RASEvent implements RASIMessageEvent
RASMessageEventencapsulates all of the information generated by aRASMessageLogger. It is not necessary to create aRASMessageEventdirectly, as the message logger handles this task. However, the methods of this class are public, should it be necessary to extendRASMessageEvent.A
RASMessageEventcontains 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
Stringswhich 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
Objectsassociated 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
Throwableobject.
Constants for these attributes are defined in the
RASConstantsclass.
The
RASMessageEventtype is defined by the set ofRASIMessageEventTYPE_XXXXconstants. Values 0x0000L up to, but not including, 0x01000L are reserved. Extensions to theRASMessageEventclass may use values outside this range for additional types. The constantRASIMessageEvent.DEFAULT_MESSAGE_MASKcontains the message types that the handlers log by default. It includes all message types.- See Also:
RASEvent, Serialized Form
-
-
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
-
Fields inherited from interface com.ibm.ras.RASConstants
KEY_CLASS_NAME, KEY_CLIENT, KEY_COMPONENT, KEY_DATE_FORMAT, KEY_DEFAULT_HANDLERS, KEY_DEFAULT_MESSAGE_HANDLERS, KEY_DEFAULT_TRACE_HANDLERS, KEY_DESCRIPTION, KEY_ENCODING, KEY_EXCEPTION, KEY_EXCEPTION_TRACE, KEY_FILE_NAME, KEY_FORMATTER_NAMES, KEY_GROUP, KEY_HANDLER_NAMES, KEY_HEX_DATA, KEY_IS_CIRCULAR, KEY_IS_LOGGING, KEY_IS_SYNC, KEY_LOGGER, KEY_LOGGING_CLASS, KEY_LOGGING_METHOD, KEY_MAX_FILE_SIZE, KEY_MAX_FILES, KEY_MAX_QUEUE_SIZE, KEY_MESSAGE_EVENT_CLASSES, KEY_MESSAGE_FILE, KEY_MESSAGE_MASK, KEY_NAME, KEY_ORGANIZATION, KEY_PRODUCT, KEY_RETRY_INTERVAL, KEY_SEPARATOR, KEY_SERVER, KEY_SOCKET_PORT, KEY_SOCKET_SERVER, KEY_SUPPRESSED_KEYS, KEY_THREAD_ID, KEY_TIME_FORMAT, KEY_TRACE_EVENT_CLASSES, KEY_TRACE_MASK, RAS_VERSION
-
-
Constructor Summary
Constructors Modifier Constructor and Description RASMessageEvent()Deprecated.Creates aRASMessageEvent.protectedRASMessageEvent(long type, java.lang.String text, java.lang.Object[] parms, java.lang.String messageFile)Deprecated.Creates aRASMessageEvent.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 aRASMessageEvent.protectedRASMessageEvent(long type, java.lang.String text, java.lang.String[] parms, java.lang.String messageFile)Deprecated.UseRASMessageEventinstead.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.UseRASMessageEventinstead.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.StringgetMessageFile()Deprecated.Gets the base message file name used to format a message.java.util.HashtablegetSupportedTypes()Deprecated.Gets the complete set of event types supported by this class.longmaskLongValue(java.lang.String types)Deprecated.Converts aStringrepresentation of a message or trace mask to itslongequivalent.java.lang.StringmaskToString(long types)Deprecated.Converts a long containing the logical OR of one or more event types to itsStringequivalent.voidsetMessageFile(java.lang.String messageFile)Deprecated.Sets the base message file name used to format a message.java.lang.StringtoString()Deprecated.Returns aStringrepresentation of this object.-
Methods inherited from class com.ibm.ras.RASEvent
getAttribute, getParameters, getText, getTimeStamp, getType, isMessageEvent, objectsToStrings, setAttribute, setMessageEvent, setParameters, setText, setTimeStamp, setType
-
-
-
-
Constructor Detail
-
RASMessageEvent
public RASMessageEvent()
Deprecated.Creates aRASMessageEvent.
-
RASMessageEvent
protected RASMessageEvent(long type, java.lang.String text, java.lang.Object[] parms, java.lang.String messageFile)Deprecated.Creates aRASMessageEvent.- Parameters:
type- The message type.text- The message text, or a message key if the message file is notnull.parms- An array ofObjectsto 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)Deprecated. UseRASMessageEventinstead.Creates aRASMessageEvent.- Parameters:
type- The message type.text- The message text, or a message key if the message file is notnull.parms- An array ofStringsto 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)Deprecated.Creates aRASMessageEvent. The caller is expected to provide a message type, key and, if needed, anyObjectparameters for the message text. If any of the other parameters are not needed, they must be set to an empty string ("") ornull.- Parameters:
type- The message type.text- The message text, or a message key if the message file is notnull.parms- An array ofObjectsto 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- AThrowableobject.
-
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)Deprecated. UseRASMessageEventinstead.Creates aRASMessageEvent. The caller is expected to provide a message type, key and, if needed, anyObjectparameters for the message text. If any of the other parameters are not needed, they must be set to an empty string ("") ornull.- Parameters:
type- The message type.text- The message text, or a message key if the message file is notnull.parms- An array ofStringsto 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- AThrowableobject.
-
-
Method Detail
-
getMessageFile
public java.lang.String getMessageFile()
Deprecated.Gets the base message file name used to format a message.- Returns:
- A message file name.
-
setMessageFile
public void setMessageFile(java.lang.String messageFile)
Deprecated.Sets the base message file name used to format a message.- Parameters:
messageFile- The message file name.
-
getSupportedTypes
public java.util.Hashtable getSupportedTypes()
Deprecated.Gets the complete set of event types supported by this class.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
Hashtablereturned by its parent.- Specified by:
getSupportedTypesin interfaceRASIEvent- Overrides:
getSupportedTypesin classRASEvent- Returns:
- A
Hashtablecontaining 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 aslongs, are returned asLongsbecause of theHashtablerequirement that all elements beObjects.
-
maskLongValue
public long maskLongValue(java.lang.String types)
Deprecated.Converts aStringrepresentation of a message or trace mask to itslongequivalent. The string must have the following format:String types = "TYPE_INFO TYPE_WARN";
Unknown values in theStringare ignored.- Specified by:
maskLongValuein interfaceRASIEvent- Overrides:
maskLongValuein classRASEvent- Parameters:
types- The blank-delimitedStringto be converted.- Returns:
- The long equivalent of the
String, formed by the logical OR of each element in theString.
-
maskToString
public java.lang.String maskToString(long types)
Deprecated.Converts a long containing the logical OR of one or more event types to itsStringequivalent. 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
longare ignored.- Specified by:
maskToStringin interfaceRASIEvent- Overrides:
maskToStringin classRASEvent- Parameters:
types- The message or trace mask.- Returns:
- The
Stringequivalent of the mask.
-
toString
public java.lang.String toString()
Deprecated.Returns aStringrepresentation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
- A representation of this object.
-
-