|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.iids.aos.messagecenter.Envelope
public class Envelope
An envelope wrapping AgentScape agent messages.
Each envelope contains data as well as address information (source and
targets AgentHandle).
| Field Summary | |
|---|---|
protected java.io.Serializable |
data
|
protected byte[] |
dataBytes
|
protected AgentHandle |
fromHandle
|
protected java.util.List<AgentHandle> |
toList
|
| Constructor Summary | |
|---|---|
Envelope()
|
|
Envelope(AgentHandle to,
AgentHandle from,
java.io.Serializable data)
Create a new envelope with contact information and data. |
|
Envelope(java.util.Collection<AgentHandle> to,
AgentHandle from,
java.io.Serializable data)
|
|
Envelope(Envelope e)
|
|
| Method Summary | |
|---|---|
void |
addTarget(AgentHandle... handles)
|
void |
addTarget(java.util.Collection<AgentHandle> to)
|
protected Envelope |
clone()
|
Envelope |
copy()
|
java.io.Serializable |
getData()
Obtain data wrapped in envelope. |
java.io.Serializable |
getData(java.lang.ClassLoader cl)
Read data using an explicit ClassLoader. |
byte[] |
getDataAsSerializedBytes()
Get data in serialized form. |
AgentHandle |
getFromHandle()
Get source handle of this message. |
java.util.Collection<AgentHandle> |
getMulticastTargets()
|
int |
getTargetCount()
|
AgentHandle |
getToHandle()
Deprecated. |
java.util.List<AgentHandle> |
getToHandles()
|
void |
removeTarget(AgentHandle targetHandle)
|
void |
setData(java.io.Serializable data)
|
void |
setFromHandle(AgentHandle fromHandle)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected byte[] dataBytes
protected transient java.io.Serializable data
protected java.util.List<AgentHandle> toList
protected AgentHandle fromHandle
| Constructor Detail |
|---|
public Envelope()
public Envelope(Envelope e)
public Envelope(AgentHandle to,
AgentHandle from,
java.io.Serializable data)
to - The AgentHandle of the target for this message.from - The AgentHandle of the source of this message.data - The (raw) data to be carried in this message.
TODO change parameter type to Object.
public Envelope(java.util.Collection<AgentHandle> to,
AgentHandle from,
java.io.Serializable data)
| Method Detail |
|---|
protected final Envelope clone()
clone in class java.lang.Objectpublic final Envelope copy()
public java.util.Collection<AgentHandle> getMulticastTargets()
public void removeTarget(AgentHandle targetHandle)
public int getTargetCount()
public void addTarget(AgentHandle... handles)
public void addTarget(java.util.Collection<AgentHandle> to)
public java.io.Serializable getData()
getData(ClassLoader) instead.
public java.io.Serializable getData(java.lang.ClassLoader cl)
cl - The ClassLoader to use for the data. If this is null, it
defaults to the envelope class loader.
public byte[] getDataAsSerializedBytes()
getData() to
retrieve your data from the envelope.
public void setData(java.io.Serializable data)
public AgentHandle getFromHandle()
public void setFromHandle(AgentHandle fromHandle)
@Deprecated public AgentHandle getToHandle()
Note: deprecated, use getToHandles() instead
public java.util.List<AgentHandle> getToHandles()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||