org.almendra.janet.cas.agents
Class AbstractAgentProxy

java.lang.Object
  extended by org.almendra.janet.cas.agents.AbstractAgentProxy
All Implemented Interfaces:
IAgentProxy
Direct Known Subclasses:
AgentProxy, MultiAgentProxy

public abstract class AbstractAgentProxy
extends java.lang.Object
implements IAgentProxy

Author:
Oliver

Field Summary
protected  Logger logger
           
protected  java.lang.String originNodeName
           
 
Constructor Summary
protected AbstractAgentProxy()
          Creates a new AbstractAgentProxy object.
  AbstractAgentProxy(Logger logger)
          Creates a new AbstractAgentProxy object.
 
Method Summary
abstract  void accept(ICommand command)
           
abstract  void accept(ICommand command, Acknowledge ack)
           
abstract  void accept(ICommand command, FutureResult futureResult)
          Send commmand to an agent expecting a result to be sent back.
abstract  void accept(ICommand command, IHistorizableCallbackHandler handler)
           
protected  void checkValidity(ICommand command)
           
 Logger getLogger()
           
protected  java.lang.String getOriginNodeName()
           
protected abstract  AgentPath replyPathSameAgent()
           
 void setLogger(Logger logger)
           
 void setOriginNodeName(java.lang.String originNodeName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.almendra.janet.cas.agents.IAgentProxy
accept, accept, accept, accept, accept, accept, accept, accept, accept, accept, size
 

Field Detail

logger

protected Logger logger

originNodeName

protected java.lang.String originNodeName
Constructor Detail

AbstractAgentProxy

protected AbstractAgentProxy()
Creates a new AbstractAgentProxy object.


AbstractAgentProxy

public AbstractAgentProxy(Logger logger)
Creates a new AbstractAgentProxy object.

Method Detail

accept

public abstract void accept(ICommand command)
                     throws java.rmi.RemoteException,
                            InvalidCommandException
Specified by:
accept in interface IAgentProxy
Throws:
java.rmi.RemoteException
InvalidCommandException

accept

public abstract void accept(ICommand command,
                            Acknowledge ack)
                     throws java.rmi.RemoteException,
                            InvalidCommandException
Specified by:
accept in interface IAgentProxy
Throws:
java.rmi.RemoteException
InvalidCommandException

accept

public abstract void accept(ICommand command,
                            FutureResult futureResult)
                     throws java.lang.IllegalArgumentException,
                            java.rmi.RemoteException,
                            InvalidCommandException
Description copied from interface: IAgentProxy
Send commmand to an agent expecting a result to be sent back.

Specified by:
accept in interface IAgentProxy
Parameters:
command - to be sent to another agent
Throws:
java.lang.IllegalArgumentException
java.rmi.RemoteException
InvalidCommandException

accept

public abstract void accept(ICommand command,
                            IHistorizableCallbackHandler handler)
                     throws java.rmi.RemoteException,
                            InvalidCommandException
Specified by:
accept in interface IAgentProxy
Throws:
java.rmi.RemoteException
InvalidCommandException

getOriginNodeName

protected java.lang.String getOriginNodeName()
Returns:
Returns the originNodeName.

setOriginNodeName

public void setOriginNodeName(java.lang.String originNodeName)
Parameters:
originNodeName - The originNodeName to set.

replyPathSameAgent

protected abstract AgentPath replyPathSameAgent()
Returns:

getLogger

public Logger getLogger()
Returns:
Returns the logger.

setLogger

public void setLogger(Logger logger)
Parameters:
logger - The logger to set.

checkValidity

protected void checkValidity(ICommand command)
                      throws InvalidCommandException
Parameters:
command -
Throws:
InvalidCommandException