|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
zeus.actors.MsgHandler
The Message Handler component implements each Zeus agent's internal "mail
sorting office", continually checking the incoming-message-queue of the
MailBox for new messages, and forwarding them to the relevant
components within the agent.
The Message Handler's behaviour is controlled by two factors: first, whether a new message represents the start of a new dialogue or it is part of an existing dialogue; and second, on the message processing rules registered with it by other components of the agent.
Change Log
----------
22/08/00 Altered spelling of organization to correct version for about 6 lines - Simon
| Nested Class Summary | |
(package private) class |
MsgHandler.AbilityLogger
|
protected class |
MsgHandler.ReportLogger
|
| Field Summary | |
protected MsgHandler.AbilityLogger |
abilityLogger
|
protected java.util.Hashtable |
abilityQueryTable
|
protected static int |
ADD
|
protected java.util.Hashtable |
addressQueryTable
|
(package private) java.util.Vector |
attributeNodes
|
(package private) static int |
cleanupInterval
|
protected AgentContext |
context
|
protected static int |
DELETE
|
protected HSet[] |
eventMonitor
|
protected static int |
FAIL
|
protected static int |
FIRE
|
protected Queue |
handleQ
|
protected RootNode |
MessageRootNode
|
protected boolean |
processing
|
protected MsgHandler.ReportLogger |
reportLogger
|
protected java.util.Hashtable |
reportQueryTable
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
MsgHandler()
|
|
MsgHandler(AgentContext context)
|
|
| Method Summary | |
void |
add_agents_abilities(Performative msg)
|
void |
add_information(Performative msg)
|
void |
add_task(Performative msg)
|
void |
addMessageHandlerMonitor(MessageHandlerMonitor monitor,
long event_type)
If your code needs to react to changes in the MessageHandler use this to add a MessageHandlerMonitor. |
void |
address_of(Performative msg)
|
void |
addRule(MessageRule r)
|
protected void |
adviseAll(Address addr)
|
void |
cancel_address(Performative msg)
|
void |
cancel_message(Performative msg)
|
void |
cancel_report(Performative msg)
|
void |
cancel_specified_ability(Performative msg)
|
private void |
debug(java.lang.String str)
|
void |
delete_task(Performative msg)
|
protected java.util.Vector |
dereference(java.util.Vector input)
Replication to handle the problem of variable clashes when agents communicate with one another with variables in the content data; |
void |
deregister(Performative msg)
|
java.lang.Object |
execRule(java.lang.String rule,
java.lang.Object object,
java.lang.String method,
Performative input)
|
protected void |
failure(Performative msg,
java.lang.String content)
|
AgentContext |
getAgentContext()
|
Queue |
getMessageQueue()
|
void |
has_ability(Performative msg)
|
protected void |
inform(Performative msg,
java.lang.String content)
|
void |
isa_facilitator(Performative msg)
|
void |
kill_yourself(Performative msg)
|
void |
log_address(Performative msg)
|
void |
log_message(Performative msg)
|
void |
log_report(Performative msg)
|
void |
log_specified_ability(Performative msg)
|
void |
lowerStatus()
|
void |
modify_task(Performative msg)
|
protected void |
not_understood(Performative msg,
java.lang.String content)
|
protected void |
notifyMonitors(int type,
MessageHandlerEvent event)
|
void |
processMessage(Performative msg)
in old versions of Zeus the msgHandler was responsible for ensuring that incomming messages were processed. |
protected void |
refuse(Performative msg,
java.lang.String content)
|
void |
register(Performative msg)
|
void |
removeMessageHandlerMonitor(MessageHandlerMonitor monitor,
long event_type)
|
void |
removeRule(java.lang.String name)
|
void |
run()
thread main method - try and read incomming messages until the universe ends |
private void |
sendInstance(Task task,
AgentContext context,
java.lang.String target,
java.lang.String replyWith)
|
private void |
sendInstanceRange(Task task,
AgentContext context,
java.lang.String target,
java.lang.String replyWith)
|
private void |
sendProcess(Task task,
AgentContext context,
java.lang.String target,
java.lang.String replyWith)
|
private void |
sendProfile(Task task,
AgentContext context,
java.lang.String target,
java.lang.String replyWith)
|
protected void |
sendServiceDescriptions(java.lang.String target,
java.lang.String replyWith)
|
void |
stopProcessing()
|
private MailBox |
waitForSetUp()
refactored to help readability - this method loops until it gets a valid MailBox from the agent, so that the system can initialise in the right order |
void |
your_abilities(Performative msg)
|
void |
your_relations(Performative msg)
|
| 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 HSet[] eventMonitor
protected static final int ADD
protected static final int FIRE
protected static final int DELETE
protected static final int FAIL
protected java.util.Hashtable addressQueryTable
protected java.util.Hashtable abilityQueryTable
protected java.util.Hashtable reportQueryTable
protected MsgHandler.ReportLogger reportLogger
protected MsgHandler.AbilityLogger abilityLogger
protected boolean processing
protected AgentContext context
protected RootNode MessageRootNode
java.util.Vector attributeNodes
static int cleanupInterval
protected Queue handleQ
| Constructor Detail |
public MsgHandler()
public MsgHandler(AgentContext context)
| Method Detail |
public AgentContext getAgentContext()
public void lowerStatus()
public void stopProcessing()
private MailBox waitForSetUp()
public void run()
public void processMessage(Performative msg)
solution: processMessage is a method that can be called by any object to see if message rules have been set that apply to this message. The servers (inboxes) are responsible for calling this method which will process the message for them - or not as they like.
This method puts the message on a queue, which is internal to the msgHandler. The thread run by msgHandler will then process it. //synch
public Queue getMessageQueue()
public void addRule(MessageRule r)
public void removeRule(java.lang.String name)
public java.lang.Object execRule(java.lang.String rule,
java.lang.Object object,
java.lang.String method,
Performative input)
protected void adviseAll(Address addr)
public void register(Performative msg)
public void deregister(Performative msg)
public void kill_yourself(Performative msg)
public void add_task(Performative msg)
public void modify_task(Performative msg)
public void delete_task(Performative msg)
public void cancel_message(Performative msg)
public void cancel_report(Performative msg)
public void cancel_specified_ability(Performative msg)
public void cancel_address(Performative msg)
public void log_message(Performative msg)
public void log_report(Performative msg)
public void log_address(Performative msg)
public void log_specified_ability(Performative msg)
public void address_of(Performative msg)
public void your_abilities(Performative msg)
protected void sendServiceDescriptions(java.lang.String target,
java.lang.String replyWith)
private void sendProfile(Task task,
AgentContext context,
java.lang.String target,
java.lang.String replyWith)
private void sendInstance(Task task,
AgentContext context,
java.lang.String target,
java.lang.String replyWith)
private void sendInstanceRange(Task task,
AgentContext context,
java.lang.String target,
java.lang.String replyWith)
private void sendProcess(Task task,
AgentContext context,
java.lang.String target,
java.lang.String replyWith)
public void your_relations(Performative msg)
public void has_ability(Performative msg)
public void isa_facilitator(Performative msg)
public void add_agents_abilities(Performative msg)
public void add_information(Performative msg)
protected void refuse(Performative msg,
java.lang.String content)
protected void failure(Performative msg,
java.lang.String content)
protected void not_understood(Performative msg,
java.lang.String content)
protected void inform(Performative msg,
java.lang.String content)
public void addMessageHandlerMonitor(MessageHandlerMonitor monitor,
long event_type)
public void removeMessageHandlerMonitor(MessageHandlerMonitor monitor,
long event_type)
protected void notifyMonitors(int type,
MessageHandlerEvent event)
protected final java.util.Vector dereference(java.util.Vector input)
private void debug(java.lang.String str)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||