|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
zeus.actors.PostMan
This component is part of the MailBox, and is responsible for
dispatching messages on demand to their recipients. This component
operates within its own thread enabling the MailBox to send and receive
multiple messages simultaneously.
It is unlikely that developers will need to call these methods directly. Although if the user wants to replace the default TCP/IP messaging mechanism this could be cleanly achieved by reimplementing the methods of this class.
| Field Summary | |
protected Queue |
ccMail
Data structure holding CC'ed messages pending dispatch to Visualisers |
protected boolean |
dispatching
|
private boolean |
fastAgent
|
private static int |
id
|
protected int |
MAX_RETRY
|
protected MailBox |
mbox
Reference to MailBox of which this is a sub-component |
protected Address |
myAddress
|
protected Queue |
outMail
Data structure holding messages pending dispatch |
(package private) int |
queueLength
|
(package private) int |
sleepTime
|
protected java.util.Hashtable |
waitQueue
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
PostMan()
|
|
PostMan(MailBox mbox,
Queue outMail,
Address myAddress)
|
|
PostMan(MailBox mbox,
Queue outMail,
Queue ccMail,
Address myAddress)
|
|
| Method Summary | |
void |
addressReceived(java.lang.String key)
|
void |
doPost()
|
void |
lowerStatus()
|
boolean |
postMsg(Performative msg,
Address addr)
postMsg sends the performative out to the other Zeus agent a socket is opened and the message is written as a string down it. |
void |
push(Performative msg)
use in preference to postMsg. |
void |
run()
this run method is the business end of the agent's communication infrastructure. |
void |
setFastAgent()
Some agents need to message quicky, some don't - they need to be sure that there reasoning components get a go at the processor. |
void |
stopDispatching()
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected final int MAX_RETRY
protected Queue outMail
protected Queue ccMail
protected MailBox mbox
protected Address myAddress
protected boolean dispatching
protected java.util.Hashtable waitQueue
private static int id
private boolean fastAgent
int queueLength
int sleepTime
| Constructor Detail |
public PostMan()
public PostMan(MailBox mbox,
Queue outMail,
Address myAddress)
public PostMan(MailBox mbox,
Queue outMail,
Queue ccMail,
Address myAddress)
| Method Detail |
public void stopDispatching()
public void lowerStatus()
public void run()
for every receiver of the message
public void doPost()
public void addressReceived(java.lang.String key)
public void setFastAgent()
public boolean postMsg(Performative msg,
Address addr)
The behaviour of this method has been changed for 1.1/2.0 to allow some flexibility on the sender field. This is mostly to allow agents to send messages and stamp them as comming from someone else - in the case of the ACC agent this allows an alias to be set up in the name server for each exterior IIOP/HTTP/WAP/UMTS agent or address of agent that is to be contacted. When the ACC is contacted under this alias it can use it's FIPAAddresBook to lookup an aid and construct a new message for forwarding
To summerise : if the sender name in the msg parameter is set then the sent message will have that sender name, and the address that is returned will also have that name.
public void push(Performative msg)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||