|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.zcu.fav.kiv.jsim.ipc.JSimMessage
public abstract class JSimMessage
A message is a piece of data sent from a process to another one. A message can have its sending and receiving process specified or not. Depending on the sender and receiver specification, the message can be sent directly between two processes or indirectly via a message box. So the following types of messages can be distinguished:
Field Summary | |
---|---|
static int |
ANY_MESSAGE_TYPE
This constant specifies that no message type filter should be used upon message reception. |
protected java.lang.Object |
data
The data sent inside the message. |
static int |
DEFAULT_JSIM_MESSAGE_TYPE
The default message type. |
protected int |
messageType
Type of the message. |
private JSimProcess |
realSender
The process that actually sent the message. |
protected JSimProcess |
receiver
The process to whom this message is to be sent. |
protected JSimProcess |
sender
The sending process. |
static JSimProcess |
UNKNOWN_RECEIVER
This constant specifies an unknown receiver. |
static JSimProcess |
UNKNOWN_SENDER
This constant specifies an unknown sender. |
Constructor Summary | |
---|---|
JSimMessage(JSimProcess sender,
JSimProcess receiver,
java.lang.Object data)
Creates a new message with the specified sender, receiver, and user data. |
|
JSimMessage(JSimProcess sender,
JSimProcess receiver,
java.lang.Object data,
int messageType)
Creates a new message with the specified sender, receiver, user data, and message type. |
Method Summary | |
---|---|
java.lang.Object |
getData()
Returns the user data that this message carries. |
int |
getMessageType()
Returns the type of the message. |
JSimProcess |
getRealSender()
Returns the process that actually sent the message. |
JSimProcess |
getReceiver()
Returns the receiver of the message. |
JSimProcess |
getSender()
Returns the sender of the message. |
void |
setRealSender(JSimProcess realSender)
Sets the real sender when the message is being sent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final JSimProcess UNKNOWN_SENDER
public static final JSimProcess UNKNOWN_RECEIVER
public static final int ANY_MESSAGE_TYPE
public static final int DEFAULT_JSIM_MESSAGE_TYPE
protected JSimProcess sender
protected JSimProcess receiver
protected java.lang.Object data
protected int messageType
private JSimProcess realSender
Constructor Detail |
---|
public JSimMessage(JSimProcess sender, JSimProcess receiver, java.lang.Object data)
sender
- The sending process. Need not be specified.receiver
- The receiver. Need not be specified.data
- User data that the message will carry.public JSimMessage(JSimProcess sender, JSimProcess receiver, java.lang.Object data, int messageType) throws JSimInvalidParametersException
sender
- The sending process. Need not be specified.receiver
- The receiver. Need not be specified.data
- User data that the message will carry.messageType
- The type of the message. Must be non-negative.
JSimInvalidParametersException
- This exception is thrown out if the message type is negative.Method Detail |
---|
public java.lang.Object getData()
public int getMessageType()
public JSimProcess getRealSender()
public void setRealSender(JSimProcess realSender)
realSender
- The process that is just now sending the message.public JSimProcess getSender()
public JSimProcess getReceiver()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |