All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sdsu.logging.LoggerMessage

java.lang.Object
   |
   +----sdsu.logging.LoggerMessage

public abstract class LoggerMessage
extends Object
implements Stringizable, Serializable
LoggerMessage and its subclasses are used by sdsu.logging.Logger. You only need to use this class directly when you are adding a new type of message to the logger. To create a new message type create a new subclass of this class. Pass the actual text of the message as an argument to the constructor of this class. Subclasses must implement the method getMessageType(). You also may wish to override the displayString saveString methods if you wish a different display output for your new message type.

The logging system is based on the logging pattern by Neil Harrison in Pattern Languages of Program Design 3 Eds Martin, Riehle, Buschman, 1998, pp 277-289

Version:
1.0 3 January 1998
Author:
Roger Whitney (whitney@cs.sdsu.edu)
See Also:
Logger, DebugMessage

Constructor Index

 o LoggerMessage(String)

Method Index

 o displayString()
Displays a string to be displayed on the screen for this message.
 o fromString(String)
Converts a string to an object.
 o getMessageType()
Returns the type of the message.
 o getMetaData()
MetaData for Message contains key-value pair "class=objectClassName".
 o logString()
Displays a string to be saved in a log for this message.
 o setMetaData(LabeledData)
Required by Stringizable.
 o toString()
Used in sending message to remote loggers.
 o toString(String)
Converts the object to a string with given header information.

Constructors

 o LoggerMessage
 public LoggerMessage(String message)

Methods

 o getMessageType
 public abstract String getMessageType()
Returns the type of the message.

 o fromString
 public void fromString(String objectString) throws ConversionException
Converts a string to an object. Used in sending message to remote loggers.

Throws: ConversionException
If there is a problem converting to object.
 o setMetaData
 public void setMetaData(LabeledData metaData)
Required by Stringizable. Messages does not require metadata internally.

 o getMetaData
 public LabeledData getMetaData()
MetaData for Message contains key-value pair "class=objectClassName". Used to recreate proper message object by remote loggers.

 o toString
 public String toString()
Used in sending message to remote loggers.

Overrides:
toString in class Object
 o toString
 public String toString(String header)
Converts the object to a string with given header information. Used in sending message to remote loggers.

 o displayString
 public String displayString()
Displays a string to be displayed on the screen for this message.

 o logString
 public String logString()
Displays a string to be saved in a log for this message.


All Packages  Class Hierarchy  This Package  Previous  Next  Index