|
ADK CVS | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecttryllian.afc.message.AbstractMessageDispatcher
Implementation class used by the agent to dispatch messages to
interested listeners (which are usually tasks).
Users of the AFC API will not have to use this class directly.
| Constructor Summary | |
AbstractMessageDispatcher()
|
|
| Method Summary | |
void |
addCommonMessageHandler(MessageHandler listener)
Adds a handler that will get notified of all messages received by the agent. |
void |
addDeliveryReportListener(DeliveryReportListener listener)
Adds a listener to all delivery reports sent to this agent. |
void |
addOutgoingMessageListener(OutgoingMessageListener listener)
Adds a listener to all message that are sent by this agent. |
Conversation |
createConversation(MessageHandler listener)
Creates a new Conversation and adds a listener to it. |
java.lang.String |
createConversationID()
Creates a unique conversation ID for this agent. |
void |
dispatch(DeliveryReport report)
As dispatch for incoming messages, but calling delivery report listeners. |
void |
dispatch(IncomingMessage message)
Relays the message to the interested listeners. |
void |
dispatchMessage(Message areMessage)
Relays the message to the interested listeners. |
void |
dispatchReport(Message areMessage)
Dispatch an incoming message that represents a delivery report. |
protected abstract void |
doSend(OutgoingMessage message)
Actually sends the message. |
Conversation |
getConversationFor(Message message)
Get the Conversation for this message, if possible. |
java.lang.String |
getName()
Returns the name of the agent. |
Conversation |
getOrCreateConversationFor(Message message)
Returns the conversation this message is/will be sent in, if initialized; otherwise, create a Conversation, if possible with an ID based on the 'conversation-id' meta field in the message. |
protected void |
log(java.lang.String message,
java.lang.Exception re)
|
void |
removeCommonMessageHandler(MessageHandler listener)
Removes a handler that listens to all messages received by the agent. |
void |
removeDeliveryReportListener(DeliveryReportListener listener)
Adds a listener to all delivery reports sent to this agent. |
void |
removeOutgoingMessageListener(OutgoingMessageListener listener)
Removes a listener to all message that are sent by this agent. |
void |
send(OutgoingMessage message)
Sends a message without using a conversation object. |
void |
setName(java.lang.String name)
Sets the name of the agent. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface tryllian.afc.message.MessageDispatcher |
getMyAddress |
| Constructor Detail |
public AbstractMessageDispatcher()
| Method Detail |
public java.lang.String getName()
MessageDispatcher
getName in interface MessageDispatcherpublic void setName(java.lang.String name)
MessageDispatcher
setName in interface MessageDispatcherpublic void dispatchMessage(Message areMessage)
public void dispatchReport(Message areMessage)
public void dispatch(IncomingMessage message)
public void dispatch(DeliveryReport report)
public void addCommonMessageHandler(MessageHandler listener)
MessageDispatcherReactiveTask to achieve this.
addCommonMessageHandler in interface MessageDispatcherlistener - object that gets notified of all messages.public void removeCommonMessageHandler(MessageHandler listener)
MessageDispatcher
removeCommonMessageHandler in interface MessageDispatcherlistener - object that used to get notified of all messages.public void addOutgoingMessageListener(OutgoingMessageListener listener)
MessageDispatcher
addOutgoingMessageListener in interface MessageDispatcherlistener - the OutgoingMessageListener to be addedpublic void removeOutgoingMessageListener(OutgoingMessageListener listener)
MessageDispatcher
removeOutgoingMessageListener in interface MessageDispatcherlistener - the OutgoingMessageListener to be removedpublic void addDeliveryReportListener(DeliveryReportListener listener)
MessageDispatcher
addDeliveryReportListener in interface MessageDispatcherlistener - the DeliveryReportListener to be added.public void removeDeliveryReportListener(DeliveryReportListener listener)
MessageDispatcher
removeDeliveryReportListener in interface MessageDispatcherlistener - the DeliveryReportListener to be removed.public Conversation createConversation(MessageHandler listener)
MessageDispatcherConversation and adds a listener to it.
A conversation is used to send and receive messages in a certain
'conversational context'.
createConversation in interface MessageDispatcher
public void send(OutgoingMessage message)
throws MessagingException
MessageDispatcher
send in interface MessageDispatchermessage - the message to be sent.
MessagingException
protected abstract void doSend(OutgoingMessage message)
throws MessagingException
MessagingExceptionpublic java.lang.String createConversationID()
public Conversation getConversationFor(Message message)
public Conversation getOrCreateConversationFor(Message message)
MessageDispatcher
getOrCreateConversationFor in interface MessageDispatcherConversation corresponding this message.
protected void log(java.lang.String message,
java.lang.Exception re)
|
Copyright 2005, Tryllian Solutions B.V. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||