|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.cougaar.core.relay.SimpleRelayBase
public abstract class SimpleRelayBase
Abstract base class for SimpleRelay implementations.
| Field Summary | |
|---|---|
protected java.lang.Object |
query
|
protected java.lang.Object |
reply
|
protected MessageAddress |
source
|
protected MessageAddress |
target
|
protected UID |
uid
|
| Constructor Summary | |
|---|---|
SimpleRelayBase(UID uid,
MessageAddress source,
MessageAddress target)
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
getQuery()
Get the query contents |
java.lang.Object |
getReply()
Get the remote reply to the query, if any. |
MessageAddress |
getSource()
The agent that created the query |
MessageAddress |
getTarget()
The agent that will set the reply |
UID |
getUID()
|
int |
hashCode()
|
void |
setQuery(java.lang.Object query)
Change the query, which is optional. |
void |
setReply(java.lang.Object reply)
Change the reply, which is optional. |
void |
setUID(UID uid)
Set the UID of this UniqueObject, which may throw a RuntimeException if the UID is already set. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final UID uid
protected final MessageAddress source
protected final MessageAddress target
protected java.lang.Object query
protected java.lang.Object reply
| Constructor Detail |
|---|
public SimpleRelayBase(UID uid,
MessageAddress source,
MessageAddress target)
| Method Detail |
|---|
public UID getUID()
getUID in interface SimpleRelaygetUID in interface UniqueObjectpublic void setUID(UID uid)
UniqueObject
setUID in interface SimpleRelaysetUID in interface UniqueObjectpublic MessageAddress getSource()
SimpleRelay
getSource in interface SimpleRelaypublic MessageAddress getTarget()
SimpleRelay
getTarget in interface SimpleRelaypublic java.lang.Object getQuery()
SimpleRelay
getQuery in interface SimpleRelaypublic void setQuery(java.lang.Object query)
SimpleRelayOnly the agent who's address matches "getSource()" may call this method, which must be followed by a blackboard "publishChange" to resend the query to the target.
Note that the relay implementation may batch changes and only send the latest change.
setQuery in interface SimpleRelayquery - the immutable query objectpublic java.lang.Object getReply()
SimpleRelayBlackboard interactions are asynchronous, so the plugin should use a subscription to wake when the SimpleRelay has changed.
getReply in interface SimpleRelaypublic void setReply(java.lang.Object reply)
SimpleRelayOnly the agent who's address matches "getTarget()" should call this method, which must be followed by a blackboard "publishChange" to resend the reply to the target.
Note that the relay implementation may batch changes and only send the latest change.
setReply in interface SimpleRelayreply - the immutable reply objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic 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 | ||||||||