aleph
Class Message
java.lang.Object
|
+--aleph.Message
- Direct Known Subclasses:
- AsynchMessage, PE.HaltMessage, PE.TellChild, PEGroup.AskParent, ReleaseResponse, RetrieveResponse
- public abstract class Message
- extends java.lang.Object
- implements java.io.Serializable, java.lang.Runnable
The base class for aleph messages. When a PE receives a message
m, it executes that message's run() method.
Messages between pairs of PEs are received and executed in FIFO order: if
PE0 sends m0 and then m1 to
PE1, then PE1 runs m0.run() to
completion befor starting m1.run(). A message's
run() method should therefore not block for non-trivial
durations. If you need to block, use aleph.AsynchMessage.
Messages from different PEs are not synchronized: if PE0 sends
m0 and PE1 sends m1 to
PE2, then m0.run() and m1.run() may
be run concurrently.
- See Also:
AsynchMessage, Serialized Form
|
Method Summary |
Message |
copy()
Use serialization to copy a message. |
int |
getPriority()
Priority is a hint to the Communication Manager |
void |
readExternal(java.io.ObjectInput in)
Externalizable subclasses my use this method to read back superclass
members. |
void |
send(Address address)
Send a message. |
void |
send(PE pe)
Send a message. |
void |
setPriority(int v)
Priority is a hint to the Communication Manager |
void |
writeExternal(java.io.ObjectOutput out)
Externalizable subclasses use this method to write out superclass
members. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
HIGH
public static final int HIGH
MEDIUM
public static final int MEDIUM
LOW
public static final int LOW
from
public Address from
next
public transient Message next
Message
public Message()
copy
public Message copy()
- Use serialization to copy a message. Used by communication managers for
local object transmission. We can't just hand over the message,
because sharing between the message and mutable objects causes pernicious
bugs.
- Returns:
- disjoint copy
getPriority
public int getPriority()
- Priority is a hint to the Communication Manager
- Returns:
- requested priority
setPriority
public void setPriority(int v)
- Priority is a hint to the Communication Manager
- Parameters:
v - Value to assign to priority.
send
public void send(PE pe)
throws java.io.IOException
- Send a message.
- Parameters:
pe - target PE
send
public void send(Address address)
throws java.io.IOException
- Send a message.
- Parameters:
address - target PE's address
writeExternal
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
- Externalizable subclasses use this method to write out superclass
members.
- See Also:
Externalizable
readExternal
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Externalizable subclasses my use this method to read back superclass
members.
- See Also:
Externalizable