|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.aglet.Message
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.
Field Summary | |
protected java.lang.Object |
arg
|
static java.lang.String |
CLONE
These kinds are used to specify the priority of the system message. |
static java.lang.String |
DEACTIVATE
|
static java.lang.String |
DISPATCH
|
static java.lang.String |
DISPOSE
|
static int |
FUTURE
|
protected java.lang.String |
kind
|
static int |
ONEWAY
|
static java.lang.String |
REVERT
|
static int |
SYNCHRONOUS
The types of message that indecates how the message was sent. |
protected long |
timestamp
|
Constructor Summary | |
Message(java.lang.String kind)
Constructs a message. |
|
Message(java.lang.String kind,
boolean b)
Constructs a message with an argument value. |
|
Message(java.lang.String kind,
char c)
Constructs a message with an argument value. |
|
Message(java.lang.String kind,
double d)
Constructs a message with an argument value. |
|
Message(java.lang.String kind,
float f)
Constructs a message with an argument value. |
|
Message(java.lang.String kind,
int i)
Constructs a message with an argument value. |
|
Message(java.lang.String kind,
long l)
Constructs a message with an argument value. |
|
Message(java.lang.String kind,
java.lang.Object arg)
Constructs a message with an argument value. |
Method Summary | |
void |
enableDeferedReply(boolean b)
Enable a defered reply. |
boolean |
equals(java.lang.Object obj)
Compares two Message objects. |
java.lang.Object |
getArg()
Gets the argument. |
java.lang.Object |
getArg(java.lang.String name)
Gets the value to which specified key is mapped in this message. |
java.lang.String |
getKind()
Gets the kind of this message |
int |
getMessageType()
Returns a type indecating how the message has been sent. |
long |
getTimeStamp()
Gets the time in milliseconds when the message was sent. |
boolean |
sameKind(Message m)
Checks if the message has same kind as the given message. |
boolean |
sameKind(java.lang.String k)
Checks if the message has same kind as given string. |
void |
sendException(java.lang.Exception exp)
Sets a exception to this message. |
void |
sendReply()
Send a reply without sepcific value. |
void |
sendReply(boolean b)
Sends a bolean value as a reply. |
void |
sendReply(char c)
Sends a character value as a reply. |
void |
sendReply(double d)
Sends a double value as a reply. |
void |
sendReply(float f)
Sends a float value as a reply. |
void |
sendReply(int i)
Sends a integer value as a reply. |
void |
sendReply(long l)
Sends a long value as a reply. |
void |
sendReply(java.lang.Object arg)
Sets a reply to this message. |
void |
setArg(java.lang.String name,
boolean value)
Set a boolean value with an associated name. |
void |
setArg(java.lang.String name,
byte value)
Set a byte value with an associated name. |
void |
setArg(java.lang.String name,
char value)
Set a character value with an associated name. |
void |
setArg(java.lang.String name,
double value)
Set a double value with an associated name. |
void |
setArg(java.lang.String name,
float value)
Set a float value with an associated name. |
void |
setArg(java.lang.String name,
int value)
Set a int value with an associated name. |
void |
setArg(java.lang.String name,
long value)
Sets a long value with an associated name. |
void |
setArg(java.lang.String name,
java.lang.Object a)
Sets a value with an associated name. |
void |
setArg(java.lang.String name,
short value)
Set a byte value with an associated name. |
java.lang.String |
toString()
Gets the string representation of the message. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int SYNCHRONOUS
public static final int FUTURE
public static final int ONEWAY
public static final java.lang.String CLONE
MessageManager.setPriority(java.lang.String, int)
public static final java.lang.String DISPATCH
public static final java.lang.String DISPOSE
public static final java.lang.String DEACTIVATE
public static final java.lang.String REVERT
protected java.lang.Object arg
protected java.lang.String kind
protected long timestamp
Constructor Detail |
public Message(java.lang.String kind)
Message msg = new Message("stock-price"); msg.setArg("company", "ibm"); msg.setArg("currency", "dollar"); Double d = (Double) proxy.sendMessage(msg);
kind
- a kind of this message.public Message(java.lang.String kind, char c)
kind
- a kind of this message.public Message(java.lang.String kind, double d)
kind
- a kind of this message.public Message(java.lang.String kind, float f)
kind
- a kind of this message.public Message(java.lang.String kind, int i)
kind
- a kind of this message.public Message(java.lang.String kind, long l)
kind
- a kind of this message.public Message(java.lang.String kind, java.lang.Object arg)
kind
- a kind of this message.arg
- an argument of this message.public Message(java.lang.String kind, boolean b)
kind
- a kind of this message.Method Detail |
public void enableDeferedReply(boolean b)
b
- true if the reply of this message should be defered.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
sameKind(com.ibm.aglet.Message)
public java.lang.Object getArg()
public java.lang.Object getArg(java.lang.String name)
name
- a name of this argument.public java.lang.String getKind()
public int getMessageType()
Aglet.handleMessage(com.ibm.aglet.Message)
public long getTimeStamp()
public boolean sameKind(Message m)
m
- a message to comparepublic boolean sameKind(java.lang.String k)
k
- a string to comparepublic void sendException(java.lang.Exception exp)
IllegalAccessError
- if a reply has already been sent.public void sendReply()
IllegalAccessError
- if a reply has already been sent.public void sendReply(char c)
public void sendReply(double d)
public void sendReply(float f)
public void sendReply(int i)
public void sendReply(long l)
public void sendReply(java.lang.Object arg)
IllegalAccessError
- if a reply has already been sent.FutureReply.getReply()
public void sendReply(boolean b)
public void setArg(java.lang.String name, byte value)
name
- a name of this argument.value
- a byte value of this argument.public void setArg(java.lang.String name, char value)
name
- a name of this argument.value
- a character value of this argument.public void setArg(java.lang.String name, double value)
name
- a name of this argument.d
- a double value of this argument.public void setArg(java.lang.String name, float value)
name
- a name of this argument.value
- a float value of this argument.public void setArg(java.lang.String name, int value)
name
- a name of this argument.value
- an integer value of this argument.public void setArg(java.lang.String name, long value)
name
- a name of this argument.value
- a long value of this argument.public void setArg(java.lang.String name, java.lang.Object a)
name
- a name of this argument.a
- a value of this argument.public void setArg(java.lang.String name, short value)
name
- a name of this argument.value
- a byte value of this argument.public void setArg(java.lang.String name, boolean value)
name
- a name of this argument.value
- a boolean value of this argument.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |