Class c2.framework.Message
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class c2.framework.Message

java.lang.Object
   |
   +----c2.framework.Message

public class Message
extends Object
All communication between components occurs through message passing. The Message class is the base class for other types of messages.

Each message as a name, a type, and parameters. In C2, the type is either Request or Notification. Parameters are named and may be of any type.

NOTE: This class should not be used directly. Use either Request or Notification instead.

See Also:
Request, Notification

Variable Index

 o name
Name of the message
 o params
List of named parameters in the message
 o type
Type (request or notification) of the message
 o typeNotification
A notification message type
 o typeRequest
A request message type

Constructor Index

 o Message(String)
 o Message(String, String)

Method Index

 o addParameter(String, Object)
Adds a parameter to the message.
 o create(String)
 o getParameter(String)
Retrieves the value of a parameter in the message.
 o name()
Returns the name of the message.
 o removeParameter(String)
Removes a parameter from the message.
 o setName(String)
Sets the name of the message.
 o toString()
Returns a String representation of the Message, including the messages's name, type and parameters.
 o type()
Returns the type of the message.

Variables

 o typeRequest
  public final static String typeRequest
A request message type
 o typeNotification
  public final static String typeNotification
A notification message type
 o type
  protected String type
Type (request or notification) of the message
 o name
  protected String name
Name of the message
 o params
  protected Hashtable params
List of named parameters in the message

Constructors

 o Message
  protected Message(String _type)
 o Message
  protected Message(String _type,
                    String _name)

Methods

 o create
  protected void create(String _type)
 o name
  public String name()
Returns the name of the message.
 o setName
  public void setName(String _name)
Sets the name of the message.
 o type
  public String type()
Returns the type of the message. The type is set by specific message types, like Request and Notification.
See Also:
Request, Notification
 o addParameter
  public void addParameter(String name,
                           Object value)
Adds a parameter to the message.
Parameters:
name - The name of the parameter.
value - The value of the parameters. Note that the value is not cloned.
 o getParameter
  public Object getParameter(String name)
Retrieves the value of a parameter in the message.
Parameters:
name - The name of the parameter to retrieve.
Returns:
Object Returns the object, or null if it doesn't not exist.
 o removeParameter
  public void removeParameter(String name)
Removes a parameter from the message.
Parameters:
name - The name of the parameter to remove.
 o toString
  public String toString()
Returns a String representation of the Message, including the messages's name, type and parameters.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index