public interface ICommandHandlerDelegate
EfferentCommandHandler
allows one to more readily extend the range of
commands handledModifier and Type | Method and Description |
---|---|
void |
abort(IEfferentCommand command,
IAgentObject agent,
EfferentCommandHandler parent)
called to abort the command
|
void |
aborted(IEfferentCommand command,
IAgentObject agent,
EfferentCommandHandler parent)
called when the command abort is completed
|
ICommandTimingEquation |
getTimingEquation(IEfferentCommand command,
IAgentObject agent,
EfferentCommandHandler handler)
return the timing equation used
|
boolean |
isInterestedIn(IEfferentCommand command)
return true if this delegate should process this type of command
|
void |
rejected(IEfferentCommand command,
IAgentObject agent,
EfferentCommandHandler parent) |
boolean |
shouldAbort(IEfferentCommand command,
IAgentObject agent,
EfferentCommandHandler handler)
return Boolean.TRUE if the command should abort (it will already be
running).
|
java.lang.Object |
shouldAccept(IEfferentCommand command,
IAgentObject agent,
EfferentCommandHandler handler)
return Boolean.TRUE if the command should be accepted for the specified
agent.
|
java.lang.Object |
shouldStart(IEfferentCommand command,
IAgentObject agent,
EfferentCommandHandler handler)
return Boolean.TRUE if the command should be started.
|
void |
start(IEfferentCommand command,
IAgentObject agent,
EfferentCommandHandler parent)
actually start the processing of the command.
|
void |
started(IEfferentCommand command,
IAgentObject agent,
EfferentCommandHandler parent)
called once the start is complete
|
boolean isInterestedIn(IEfferentCommand command)
command
- java.lang.Object shouldAccept(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler handler)
command
- agent
- handler
- java.lang.Object shouldStart(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler handler)
EfferentCommandHandler
will next
call start(IEfferentCommand, IAgentObject, EfferentCommandHandler)
and then send a state update for the command noting that the actual state
is running.command
- agent
- handler
- boolean shouldAbort(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler handler)
EfferentCommandHandler
will next call
abort(IEfferentCommand, IAgentObject, EfferentCommandHandler)
and
send a state update for the command with its actual state as ABORTEDcommand
- agent
- handler
- ICommandTimingEquation getTimingEquation(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler handler)
command
- agent
- handler
- void start(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler parent)
EfferentCommandHandler
is passed along as well so that later
EfferentCommandHandler.completed(IEfferentCommand, Object)
may be
called. However, it should not be called from within here. The
reason is simple, after returning from start,
EfferentCommandHandler
will set the state of the command as
RUNNING. If you call
EfferentCommandHandler.completed(IEfferentCommand, Object)
from
within start, the states will be inconsistent. Any state changes
must occur after start returns.command
- agent
- parent
- void started(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler parent)
command
- agent
- parent
- void abort(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler parent)
command
- agent
- parent
- void aborted(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler parent)
command
- agent
- parent
- void rejected(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler parent)