org.micropsi.comp.agent.micropsi.scripting
Class AgentScriptingManager

java.lang.Object
  extended byorg.micropsi.comp.agent.micropsi.scripting.AgentScriptingManager
All Implemented Interfaces:
ScriptingManagerIF

public class AgentScriptingManager
extends java.lang.Object
implements ScriptingManagerIF

AgentScriptingManager MicroPsi agent implementation of the ScriptingManagerIF.


Constructor Summary
AgentScriptingManager(LocalNetFacade net, MicroPsiAgent agent, Logger logger)
          Constructor with initialisation parameters for script threads.
 
Method Summary
 void addScriptStateListener(ScriptStateListenerIF listener)
          Adds a listener to get notified when the script state changes.
 boolean executeScript(Script script)
          Executes a script.
 void forceTerminateScript()
          Forces the script's thread to stop.
 void removeScriptStateListener(ScriptStateListenerIF listener)
          Removes a script state listener
 boolean terminateScript()
          Sends a terminate request to the current script.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentScriptingManager

public AgentScriptingManager(LocalNetFacade net,
                             MicroPsiAgent agent,
                             Logger logger)
Constructor with initialisation parameters for script threads.

Parameters:
agent - the agent
net - the net
logger - the logger
Method Detail

executeScript

public boolean executeScript(Script script)
Description copied from interface: ScriptingManagerIF
Executes a script.

Specified by:
executeScript in interface ScriptingManagerIF
Parameters:
script - the script to be executed.
Returns:
true iff this scripting manager could execute the script at the current point of time.

terminateScript

public boolean terminateScript()
Description copied from interface: ScriptingManagerIF
Sends a terminate request to the current script.

Specified by:
terminateScript in interface ScriptingManagerIF
Returns:
false iff there was no current script.

forceTerminateScript

public void forceTerminateScript()
Description copied from interface: ScriptingManagerIF
Forces the script's thread to stop. This is meant to be the last ressort and should not be used programmatically to stop a script.

Specified by:
forceTerminateScript in interface ScriptingManagerIF

addScriptStateListener

public void addScriptStateListener(ScriptStateListenerIF listener)
Description copied from interface: ScriptingManagerIF
Adds a listener to get notified when the script state changes.

Specified by:
addScriptStateListener in interface ScriptingManagerIF
Parameters:
listener - the listener, must not be null

removeScriptStateListener

public void removeScriptStateListener(ScriptStateListenerIF listener)
Description copied from interface: ScriptingManagerIF
Removes a script state listener

Specified by:
removeScriptStateListener in interface ScriptingManagerIF
Parameters:
listener - the listener, must not be null.

(c) by Micropsi Project: http://www.cognitive-agents.org

.