org.jactr.core.runtime.controller
Class DefaultController

java.lang.Object
  extended by org.jactr.core.runtime.controller.DefaultController
All Implemented Interfaces:
IController
Direct Known Subclasses:
DebugController

public class DefaultController
extends java.lang.Object
implements IController


Constructor Summary
DefaultController()
           
 
Method Summary
 void attach()
          attach to the runtime - called by the runtime during ACTRRuntime.setController();
 java.util.concurrent.Future<java.lang.Boolean> complete()
          complete().get() will block until completeds
 void detach()
          detach the runtime - called by the runtime during ACTRRuntime.setController(null);
 java.util.Collection<IModel> getRunningModels()
           
 java.util.Collection<IModel> getSuspendedModels()
           
 java.util.Collection<IModel> getTerminatedModels()
           
 boolean isRunning()
           
 boolean isSuspended()
           
 java.util.concurrent.Future<java.lang.Boolean> resume()
          resume from a suspend
 java.util.concurrent.Future<java.lang.Boolean> start()
          run the models..The runtime is not actually running until at least one model has finished initialization.
 java.util.concurrent.Future<java.lang.Boolean> start(boolean suspendImmediately)
          start the models but suspend at the start of the first cycle
 java.util.concurrent.Future<java.lang.Boolean> stop()
          stop all the current running models at the nearest possible moment.
 java.util.concurrent.Future<java.lang.Boolean> suspend()
          pause at the next immediate opportunity
 java.util.concurrent.Future<java.lang.Boolean> terminate()
          force all the models to terminate
 java.util.concurrent.Future<java.lang.Boolean> waitForCompletion()
           
 java.util.concurrent.Future<java.lang.Boolean> waitForResumption()
           
 java.util.concurrent.Future<java.lang.Boolean> waitForStart()
          returns a future that can be blocked on until the runtime starts fully (i.e.
 java.util.concurrent.Future<java.lang.Boolean> waitForSuspension()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultController

public DefaultController()
Method Detail

attach

public void attach()
Description copied from interface: IController
attach to the runtime - called by the runtime during ACTRRuntime.setController();

Specified by:
attach in interface IController

detach

public void detach()
Description copied from interface: IController
detach the runtime - called by the runtime during ACTRRuntime.setController(null);

Specified by:
detach in interface IController

getRunningModels

public java.util.Collection<IModel> getRunningModels()
Specified by:
getRunningModels in interface IController

getSuspendedModels

public java.util.Collection<IModel> getSuspendedModels()
Specified by:
getSuspendedModels in interface IController

getTerminatedModels

public java.util.Collection<IModel> getTerminatedModels()
Specified by:
getTerminatedModels in interface IController

isRunning

public boolean isRunning()
Specified by:
isRunning in interface IController

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface IController

start

public java.util.concurrent.Future<java.lang.Boolean> start()
Description copied from interface: IController
run the models..The runtime is not actually running until at least one model has finished initialization.

Specified by:
start in interface IController

start

public java.util.concurrent.Future<java.lang.Boolean> start(boolean suspendImmediately)
Description copied from interface: IController
start the models but suspend at the start of the first cycle

Specified by:
start in interface IController

complete

public java.util.concurrent.Future<java.lang.Boolean> complete()
Description copied from interface: IController
complete().get() will block until completeds

Specified by:
complete in interface IController
Returns:

stop

public java.util.concurrent.Future<java.lang.Boolean> stop()
Description copied from interface: IController
stop all the current running models at the nearest possible moment. This is a clean stop.

Specified by:
stop in interface IController

suspend

public java.util.concurrent.Future<java.lang.Boolean> suspend()
Description copied from interface: IController
pause at the next immediate opportunity

Specified by:
suspend in interface IController

resume

public java.util.concurrent.Future<java.lang.Boolean> resume()
Description copied from interface: IController
resume from a suspend

Specified by:
resume in interface IController

terminate

public java.util.concurrent.Future<java.lang.Boolean> terminate()
Description copied from interface: IController
force all the models to terminate

Specified by:
terminate in interface IController

waitForCompletion

public java.util.concurrent.Future<java.lang.Boolean> waitForCompletion()
Specified by:
waitForCompletion in interface IController

waitForResumption

public java.util.concurrent.Future<java.lang.Boolean> waitForResumption()
Specified by:
waitForResumption in interface IController

waitForStart

public java.util.concurrent.Future<java.lang.Boolean> waitForStart()
Description copied from interface: IController
returns a future that can be blocked on until the runtime starts fully (i.e. a model is running)

Specified by:
waitForStart in interface IController
Returns:

waitForSuspension

public java.util.concurrent.Future<java.lang.Boolean> waitForSuspension()
Specified by:
waitForSuspension in interface IController