unsw.cse.mica.agent
Interface AgentTransport

All Superinterfaces:
AgentActions
All Known Implementing Classes:
CompoundAgentTransport, LocalAgentTransport, NullAgentTransport, SecureXMLOverSSLAgentTransport, SecureXMLOverTCPAgentTransport, SynchronizedTransport, XMLOverSSLAgentTransport, XMLOverTCPAgentTransport

public interface AgentTransport
extends AgentActions

Manages all communications between an agent and the blackboard.

The AgentTransport is is agent's interface to the blackboard. It encapsulates all the actions available to the agent, along with a couple of additional support methods. A class implementing the transport is responsible for ensuring that the actions get to the blackboard and that the replies from the blackboard are processed correctly. It must also ensure that messages from the blackboard are also handled correctly and forwarded to the agent.

AgentTransport is an interface, as it is possible several different agent transports could be defined.

Author:
Waleed Kadous

Method Summary
 java.lang.String getAgentName()
          Get the name that was provided for this agent at connection.
 boolean isConnected()
          Check whether the transport is connected to the blackboard or not.
 void setMessageHandler(MessageHandler handler)
          Tell the transport to use a new message handler.
 
Methods inherited from interface unsw.cse.mica.agent.AgentActions
connect, deleteMob, disconnect, getTypeManager, mobSearch, readMob, register, replaceMob, unregister, writeMob
 

Method Detail

isConnected

boolean isConnected()
Check whether the transport is connected to the blackboard or not.

Returns:
true if the agent is connect to the blackboard, false otherwise
Since:
Mica 2.0

getAgentName

java.lang.String getAgentName()
Get the name that was provided for this agent at connection.

Returns:
the agents name on the blackboard, or null if the transport is not connected
Since:
Mica 2.0

setMessageHandler

void setMessageHandler(MessageHandler handler)
Tell the transport to use a new message handler. WARNING: Use of this method can break the agent-transport connection. In general, AgentTransports are given an agent in their constructor and this method will not need to be called. It is is provided primarily to allow the creation of more complex transports such as the SynchronizedTransport whose functionality is built on top of an underlying transport.

Parameters:
handler - the new message handler for the transport