net.hivecell.hive.agent
Interface Agent

All Known Subinterfaces:
AgentMonitoringAgent, CellListAgent, ChatAgent, ChatGroupServerAgent, CreditsControllingHuntingAgent, CreditsHuntingAgent, DJAgent, EchoAgent, EventFloatTranslatingAgent, EventReceivingAgent, EventSendingAgent, EventTransceivingAgent, ExternalInterfaceAgent, FloatSourceAgent, ImageSourceAgent, MusicPlayingAgent, TwoWayConnectionAgent
All Known Implementing Classes:
AgentImpl

public interface Agent
extends RemoteDescribable

the base remote interface for all agents. methods in this interface and its children are visible over the network. all methods must throw remoteexception.

Version:
$Revision: 1.1 $

Method Summary
 void blockUntilReady()
          m block if this agent is not yet ready, this method will release the caller when this agent has become ready
 void configure(java.lang.Object o, Description desc)
          Tells the agent to configure itself from the DOM Node doc.
 boolean connectTo(Agent otherAgent)
          connects this agent to some other agent.
 void diePlease()
          ask this agent to politely die
 void disconnectFrom(Agent otherAgent)
          disconnects this agent from the specified other agent.
 void disconnectFromAll()
          disconnects this agent from all agents.
 java.util.Vector getActionCommands()
          get a list of strings which are the labels for this agent's command menu
 CellAddress getAddress()
          return what cell address this agent is on
 RemoteCell getCell()
          find out which server the agent lives on.
 Description getDescription()
          get the semantic description of this agent.
 SerializableImage getIcon()
          get the icon for this agent.
 java.lang.String getName()
          get a name for this agent.
 boolean invokeActionCommand(java.lang.String com)
          ask this agent to invoke a command from the agent's command menu
 boolean isReady()
          see if this agent is ready for business
 java.util.Vector listAllIncomingConnections()
          ask this agent for all its incoming connections
 java.util.Vector listAllOutgoingConnections()
          ask this agent for all its outgoing connections
 
Methods inherited from interface net.hivecell.hive.description.RemoteDescribable
setDescription
 

Method Detail

getCell

public RemoteCell getCell()
                   throws java.rmi.RemoteException
find out which server the agent lives on.
Returns:
the remote server of the agent

getAddress

public CellAddress getAddress()
                       throws java.rmi.RemoteException
return what cell address this agent is on
Returns:
the cell address of this agent

isReady

public boolean isReady()
                throws java.rmi.RemoteException
see if this agent is ready for business
Returns:
true if this agent is ready to go, false otherwise

blockUntilReady

public void blockUntilReady()
                     throws java.rmi.RemoteException
m block if this agent is not yet ready, this method will release the caller when this agent has become ready

diePlease

public void diePlease()
               throws java.rmi.RemoteException
ask this agent to politely die

connectTo

public boolean connectTo(Agent otherAgent)
                  throws java.rmi.RemoteException
connects this agent to some other agent. it is up to the agent to define the semantics of what this means.
Parameters:
otherAgent - reference to the agent to connect to
Returns:
whether the connection was successful

disconnectFromAll

public void disconnectFromAll()
                       throws java.rmi.RemoteException
disconnects this agent from all agents.

disconnectFrom

public void disconnectFrom(Agent otherAgent)
                    throws java.rmi.RemoteException
disconnects this agent from the specified other agent.
Parameters:
otherAgent - the agent that we are going to disappear from

listAllIncomingConnections

public java.util.Vector listAllIncomingConnections()
                                            throws java.rmi.RemoteException
ask this agent for all its incoming connections
Returns:
a vector of agents which are all on incoming edges

listAllOutgoingConnections

public java.util.Vector listAllOutgoingConnections()
                                            throws java.rmi.RemoteException
ask this agent for all its outgoing connections
Returns:
a vector of agents which are out outgoing edges

getDescription

public Description getDescription()
                           throws java.rmi.RemoteException
get the semantic description of this agent.
Specified by:
getDescription in interface RemoteDescribable
Returns:
the description of the agent

getIcon

public SerializableImage getIcon()
                          throws java.rmi.RemoteException
get the icon for this agent.
Returns:
the serializable image of the agent's icon

getName

public java.lang.String getName()
                         throws java.rmi.RemoteException
get a name for this agent.
Returns:
the name that this agent has chosen for itself

configure

public void configure(java.lang.Object o,
                      Description desc)
               throws java.rmi.RemoteException
Tells the agent to configure itself from the DOM Node doc.
Parameters:
o - the object that asked to configure the agent
doc - The DOM Document (root node)

getActionCommands

public java.util.Vector getActionCommands()
                                   throws java.rmi.RemoteException
get a list of strings which are the labels for this agent's command menu
Returns:
a vector of strings

invokeActionCommand

public boolean invokeActionCommand(java.lang.String com)
                            throws java.rmi.RemoteException
ask this agent to invoke a command from the agent's command menu
Parameters:
com - a string representing the command that we wish to have called
Returns:
true if the method was called, false otherwise