All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.aglet.Message
java.lang.Object
|
+----com.ibm.aglet.Message
- public class Message
- extends Object
- implements Serializable
The Message class is a object that holds its kind
and arguments passed to the receiver. In handleMessage() method
on Aglet class, the reply to the request can be set if any.
-
CLONE
- These kinds are used to specify the priority of the system message.
-
DEACTIVATE
-
-
DISPATCH
-
-
DISPOSE
-
-
FUTURE
-
-
ONEWAY
-
-
REVERT
-
-
SYNCHRONOUS
- The types of message that indecates how the message was sent.
-
Message(String)
- Constructs a message.
-
Message(String, boolean)
- Constructs a message with an argument value.
-
Message(String, char)
- Constructs a message with an argument value.
-
Message(String, double)
- Constructs a message with an argument value.
-
Message(String, float)
- Constructs a message with an argument value.
-
Message(String, int)
- Constructs a message with an argument value.
-
Message(String, long)
- Constructs a message with an argument value.
-
Message(String, Object)
- Constructs a message with an argument value.
-
enableDeferedReply(boolean)
- Enable a defered reply.
-
equals(Object)
- Compares two Message objects.
-
getArg()
- Gets the argument.
-
getArg(String)
- Gets the value to which specified key is mapped in this message.
-
getKind()
- Gets the kind of this message
-
getMessageType()
- Returns a type indecating how the message has been sent.
-
getTimeStamp()
- Gets the time in milliseconds when the message was sent.
-
sameKind(Message)
- Checks if the message has same kind as the given message.
-
sameKind(String)
- Checks if the message has same kind as given string.
-
sendException(Exception)
- Sets a exception to this message.
-
sendReply()
- Send a reply without sepcific value.
-
sendReply(boolean)
- Sends a bolean value as a reply.
-
sendReply(char)
- Sends a character value as a reply.
-
sendReply(double)
- Sends a double value as a reply.
-
sendReply(float)
- Sends a float value as a reply.
-
sendReply(int)
- Sends a integer value as a reply.
-
sendReply(long)
- Sends a long value as a reply.
-
sendReply(Object)
- Sets a reply to this message.
-
setArg(String, boolean)
- Set a boolean value with an associated name.
-
setArg(String, byte)
- Set a bye value with an associated name.
-
setArg(String, char)
- Set a character value with an associated name.
-
setArg(String, double)
- Set a double value with an associated name.
-
setArg(String, float)
- Set a float value with an associated name.
-
setArg(String, int)
- Set a int value with an associated name.
-
setArg(String, long)
- Sets a long value with an associated name.
-
setArg(String, Object)
- Sets a value with an associated name.
-
setArg(String, short)
- Set a bye value with an associated name.
-
toString()
- Gets the string representation of the message.
SYNCHRONOUS
public static final int SYNCHRONOUS
- The types of message that indecates how the message was sent.
- See Also:
- getMessageType
FUTURE
public static final int FUTURE
ONEWAY
public static final int ONEWAY
CLONE
public static final String CLONE
- These kinds are used to specify the priority of the system message.
- See Also:
- setPriority
DISPATCH
public static final String DISPATCH
DISPOSE
public static final String DISPOSE
DEACTIVATE
public static final String DEACTIVATE
REVERT
public static final String REVERT
Message
public Message(String kind)
- Constructs a message. The message object created by
this constructor have a hashtable which can be used
for argument-value pair.
Message msg = new Message("stock-price");
msg.setArg("company", "ibm");
msg.setArg("currency", "dollar");
Double d = (Double) proxy.sendMessage(msg);
- Parameters:
- kind - a kind of this message.
Message
public Message(String kind,
Object arg)
- Constructs a message with an argument value.
- Parameters:
- kind - a kind of this message.
- arg - an argument of this message.
Message
public Message(String kind,
int i)
- Constructs a message with an argument value.
- Parameters:
- kind - a kind of this message.
Message
public Message(String kind,
double d)
- Constructs a message with an argument value.
- Parameters:
- kind - a kind of this message.
Message
public Message(String kind,
float f)
- Constructs a message with an argument value.
- Parameters:
- kind - a kind of this message.
Message
public Message(String kind,
boolean b)
- Constructs a message with an argument value.
- Parameters:
- kind - a kind of this message.
Message
public Message(String kind,
char c)
- Constructs a message with an argument value.
- Parameters:
- kind - a kind of this message.
Message
public Message(String kind,
long l)
- Constructs a message with an argument value.
- Parameters:
- kind - a kind of this message.
getKind
public String getKind()
- Gets the kind of this message
sameKind
public boolean sameKind(String k)
- Checks if the message has same kind as given string.
- Parameters:
- k - a string to compare
sameKind
public boolean sameKind(Message m)
- Checks if the message has same kind as the given message.
- Parameters:
- m - a message to compare
getTimeStamp
public long getTimeStamp()
- Gets the time in milliseconds when the message was sent.
getArg
public Object getArg()
- Gets the argument.
getMessageType
public int getMessageType()
- Returns a type indecating how the message has been sent.
This works only for the message passed to the handleMessage method.
- See Also:
- handleMessage
setArg
public void setArg(String name,
Object a)
- Sets a value with an associated name.
- Parameters:
- name - a name of this argument.
- a - a value of this argument.
setArg
public void setArg(String name,
boolean value)
- Set a boolean value with an associated name.
- Parameters:
- name - a name of this argument.
- value - a boolean value of this argument.
setArg
public void setArg(String name,
byte value)
- Set a bye value with an associated name.
- Parameters:
- name - a name of this argument.
- value - a byte value of this argument.
setArg
public void setArg(String name,
short value)
- Set a bye value with an associated name.
- Parameters:
- name - a name of this argument.
- value - a byte value of this argument.
setArg
public void setArg(String name,
int value)
- Set a int value with an associated name.
- Parameters:
- name - a name of this argument.
- value - an integer value of this argument.
setArg
public void setArg(String name,
double value)
- Set a double value with an associated name.
- Parameters:
- name - a name of this argument.
- d - a double value of this argument.
setArg
public void setArg(String name,
float value)
- Set a float value with an associated name.
- Parameters:
- name - a name of this argument.
- value - a float value of this argument.
setArg
public void setArg(String name,
char value)
- Set a character value with an associated name.
- Parameters:
- name - a name of this argument.
- value - a character value of this argument.
setArg
public void setArg(String name,
long value)
- Sets a long value with an associated name.
- Parameters:
- name - a name of this argument.
- value - a long value of this argument.
getArg
public Object getArg(String name)
- Gets the value to which specified key is mapped in this message.
- Parameters:
- name - a name of this argument.
- Returns:
- a value of this argument.
sendReply
public void sendReply(Object arg)
- Sets a reply to this message.
- Throws: IllegalAccessError
- if a reply has already been sent.
- See Also:
- getReply
sendReply
public void sendReply()
- Send a reply without sepcific value.
- Throws: IllegalAccessError
- if a reply has already been sent.
sendException
public void sendException(Exception exp)
- Sets a exception to this message.
- Throws: IllegalAccessError
- if a reply has already been sent.
sendReply
public void sendReply(int i)
- Sends a integer value as a reply.
sendReply
public void sendReply(double d)
- Sends a double value as a reply.
sendReply
public void sendReply(float f)
- Sends a float value as a reply.
sendReply
public void sendReply(boolean b)
- Sends a bolean value as a reply.
sendReply
public void sendReply(char c)
- Sends a character value as a reply.
sendReply
public void sendReply(long l)
- Sends a long value as a reply.
enableDeferedReply
public void enableDeferedReply(boolean b)
- Enable a defered reply. If this feature is enabled, this message
is assumed that it will be handled later. Neither a reply nor
a exception does not sent to the callee unless you explicitly
send a reply regardless of whatever has been returned in
handleMessage method.
- Parameters:
- b - true if the reply of this message should be defered.
equals
public boolean equals(Object obj)
- Compares two Message objects. Use sameKind() method to compare
a message with its string representation of the kind.
- Overrides:
- equals in class Object
- See Also:
- sameKind
toString
public String toString()
- Gets the string representation of the message.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index