|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
AGENT
- public abstract class AgentModule<AGENT extends IAgent>
Ancestor of all agent modules that contains ComponentController
and defines protected methods for the control of
the module's lifecycle (AgentModule#start()
, stop()
, pause()
, resume()
,
kill()
and reset()
). Override them when needed.
Field Summary | |
---|---|
protected AGENT |
agent
|
protected ComponentController |
controller
|
protected IComponentBus |
eventBus
|
protected java.util.logging.Logger |
log
|
Constructor Summary | |
---|---|
AgentModule(AGENT agent)
Initialize agent module - it will start ComponentDependencyType .STARTS_WITH the agent. |
|
AgentModule(AGENT agent,
java.util.logging.Logger log)
Initialize agent module - it will start ComponentDependencyType .STARTS_WITH the agent. |
|
AgentModule(AGENT agent,
java.util.logging.Logger log,
ComponentDependencies dependencies)
Initialize agent module with custom dependencies. |
Method Summary | |
---|---|
protected void |
cleanUp()
Hook where to perform clean up of data structures of the module. |
Token |
getComponentId()
Unique identification of the component. |
java.util.logging.Logger |
getLog()
Returns a logger used by the AgentModule. |
ImmutableFlag<ComponentState> |
getState()
Returns state of the component. |
protected Token |
initComponentId()
Returns token made from simple name of the module's class. |
boolean |
isRunning()
Whether the component is running. |
protected void |
kill()
Kills the agent module. |
protected void |
pause()
Pauses the agent module. |
protected void |
reset()
Resets the agent module so it may be reused. |
protected void |
resume()
Resumes the agent module. |
protected void |
start(boolean startToPaused)
Starts the agent module. |
protected void |
stop()
Stops the agent module. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final AGENT extends IAgent agent
protected java.util.logging.Logger log
protected final ComponentController controller
protected final IComponentBus eventBus
Constructor Detail |
---|
public AgentModule(AGENT agent)
ComponentDependencyType
.STARTS_WITH the agent.
agent
- public AgentModule(AGENT agent, java.util.logging.Logger log)
ComponentDependencyType
.STARTS_WITH the agent.
agent
- log
- should be used, if null is provided, it is created automaticallypublic AgentModule(AGENT agent, java.util.logging.Logger log, ComponentDependencies dependencies)
agent
- log
- which should be used, if null is provided, it is created automaticallydependencies
- Method Detail |
---|
public java.util.logging.Logger getLog()
protected Token initComponentId()
Called during the construction of the module, called only once (and even before your constructors take effect)!
public Token getComponentId()
IComponent
getComponentId
in interface IComponent
public boolean isRunning()
AbstractComponentControllerBase.isRunning()
public ImmutableFlag<ComponentState> getState()
public java.lang.String toString()
toString
in class java.lang.Object
protected void start(boolean startToPaused)
protected void stop()
Calls cleanUp()
.
protected void kill()
Calls cleanUp()
.
protected void pause()
protected void resume()
protected void reset()
Calls cleanUp()
.
protected void cleanUp()
Called from stop()
, kill()
, reset()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |