|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fipaos.agent.conversation.lightweight.LightweightConversationManagerImpl
Constructor Summary | |
LightweightConversationManagerImpl(ConversationListener cl,
MessageSender ms,
FIPAOSAgent agent,
DatabaseProfile db_profile,
ProtocolProfile protocol_profile)
Create and initalise the CM. |
Method Summary | |
Conversation |
addConversation(java.lang.String protocol)
Method to create a new conversation given a protcol, and add it to the active list. |
boolean |
addProtocol(java.lang.String protocol_name,
java.lang.String protocol_defn)
Adds a new protocol to the CM - this implementation will always return true since protocols are not forced. |
Conversation |
getConversation(java.lang.String conversation_id)
Retrieves an active/previous Conversation that an Agent has had |
void |
handleMessage(Message msg)
Looks at a Message and checks to see if it part of an exisiting conversation. |
boolean |
hasProtocol(java.lang.String protocol)
Indicates whether the specified protocol is already in the cache, i.e. |
static void |
main(java.lang.String[] args)
|
void |
receiveMessage(Message msg)
Deal with the incoming message |
void |
removeConversation(java.lang.String id)
Removes the given conversation from the ConversationManager - this may be necessary in order to end conversations that have no defined end-point |
void |
run()
When an object implementing interface Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread. |
void |
sendMessage(Message msg)
Attempt to send the message given |
void |
setMessageReceiver(MessageReceiver mr)
Set the reference to the MessageReceiver that should receive incoming messages |
void |
setMessageSender(MessageSender ms)
Set the reference to the MessageSender that should send-outgoing messages |
void |
shutdown()
Attempt to shutdown the implementation safely |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LightweightConversationManagerImpl(ConversationListener cl, MessageSender ms, FIPAOSAgent agent, DatabaseProfile db_profile, ProtocolProfile protocol_profile)
Method Detail |
public Conversation addConversation(java.lang.String protocol) throws UnknownProtocolException
addConversation
in interface ConversationManager
public Conversation getConversation(java.lang.String conversation_id) throws InvalidConversationIDException
getConversation
in interface ConversationManager
public void removeConversation(java.lang.String id) throws InvalidConversationIDException
removeConversation
in interface ConversationManager
id
- The conversation-id of the conversation to removepublic boolean addProtocol(java.lang.String protocol_name, java.lang.String protocol_defn)
addProtocol
in interface ConversationManager
protocol_name
- The name of the protocol to store (e.g. fipa-new-protocol)protocol_defn
- The RDF definition of the protocolpublic boolean hasProtocol(java.lang.String protocol)
hasProtocol
in interface ConversationManager
protocol
- The protocol to check forpublic void sendMessage(Message msg)
sendMessage
in interface MessageSender
message
- The message to be sentpublic void setMessageSender(MessageSender ms)
setMessageSender
in interface MessageReceiver
public void setMessageReceiver(MessageReceiver mr)
setMessageReceiver
in interface MessageSender
public void shutdown()
MessageSender
shutdown
in interface MessageSender
public void receiveMessage(Message msg)
MessageReceiver
receiveMessage
in interface MessageReceiver
fipaos.mts.MessageReceiver
message
- The incomming messagepublic void run()
Runnable
is used
to create a thread, starting the thread causes the object's
run
method to be called in that separately executing
thread.
The general contract of the method run
is that it may
take any action whatsoever.
run
in interface java.lang.Runnable
Thread.run()
public void handleMessage(Message msg) throws UnknownProtocolException, InvalidConversationIDException, ProtocolErrorException, ConversationFinishedException
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |