public final class Message extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
(package private) short |
dest
The unique id. of destination server
|
(package private) static byte |
DETACHABLE |
(package private) AgentId |
from
AgentId of sender. |
(package private) static int |
LENGTH |
(package private) Notification |
not
The notification.
|
(package private) static byte |
NOTNULL |
(package private) static byte |
NULL |
(package private) static byte |
PERSISTENT |
private static Pool |
pool |
(package private) static long |
serialVersionUID
define serialVersionUID for interoperability
|
(package private) short |
source
The unique id. of source server
|
(package private) int |
stamp
The current stamp of the message
|
private String |
stringId |
(package private) AgentId |
to
AgentId of destination agent. |
Modifier | Constructor and Description |
---|---|
private |
Message()
Construct a new message.
|
Modifier and Type | Method and Description |
---|---|
(package private) static Message |
alloc()
Allocates a message from the pool.
|
(package private) static Message |
alloc(AgentId from,
AgentId to,
Notification not)
Allocates a message from the pool.
|
StringBuffer |
appendToString(StringBuffer strbuf)
Adds a string representation for this object in the
StringBuffer parameter.
|
(package private) void |
delete()
Deletes the current object in persistent storage.
|
(package private) void |
free()
Frees the message to the pool.
|
(package private) short |
getDest()
Get the unique server id. of the addressee of this message
|
AgentId |
getFrom() |
Notification |
getNot() |
(package private) short |
getSource()
Get the unique server id. of the sender of this message
|
int |
getStamp()
Get the stamp of this message
|
AgentId |
getTo() |
boolean |
isPersistent()
Tests if the associated notification is persistent or not.
|
(package private) static Message |
load(String name)
Restores the object state from the persistent storage.
|
(package private) void |
optFromByte(byte opt) |
(package private) byte |
optToByte() |
private void |
readObject(ObjectInputStream in)
The readObject method is responsible for reading from the stream and
restoring the classes fields.
|
(package private) void |
save()
Saves the object state on persistent storage.
|
private void |
set(AgentId from,
AgentId to,
Notification not) |
String |
toString()
Returns a string representation for this object.
|
(package private) String |
toStringId() |
private void |
writeObject(ObjectOutputStream out)
The writeObject method is responsible for writing the state of the
object for its particular class so that the corresponding readObject
method can restore it.
|
static final long serialVersionUID
transient AgentId from
AgentId
of sender.transient AgentId to
AgentId
of destination agent.transient Notification not
transient short source
transient short dest
transient int stamp
static final int LENGTH
static final byte NULL
static final byte NOTNULL
static final byte PERSISTENT
static final byte DETACHABLE
private transient String stringId
private static Pool pool
short getSource()
short getDest()
public int getStamp()
public AgentId getFrom()
public AgentId getTo()
public Notification getNot()
public String toString()
public StringBuffer appendToString(StringBuffer strbuf)
byte optToByte()
void optFromByte(byte opt)
private void writeObject(ObjectOutputStream out) throws IOException
IOException
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
final String toStringId()
public boolean isPersistent()
void save() throws IOException
IOException
static Message load(String name) throws IOException, ClassNotFoundException
IOException
- when accessing the stored imageClassNotFoundException
- if the stored image class may not be foundvoid delete()
static Message alloc()
static Message alloc(AgentId from, AgentId to, Notification not)
from
- id of source Agent.to
- id of destination Agent.not
- Notification to be signaled.void free()
private void set(AgentId from, AgentId to, Notification not)
Copyright © 2013 ScalAgent D.T.. All Rights Reserved.