org.jactr.core.module.asynch
Class AbstractAsynchronousModule

java.lang.Object
  extended by org.jactr.core.module.AbstractModule
      extended by org.jactr.core.module.asynch.AbstractAsynchronousModule
All Implemented Interfaces:
IAsynchronousModule, IModule, IInitializable, IInstallable, IParameterized
Direct Known Subclasses:
AbstractPerceptualModule

public abstract class AbstractAsynchronousModule
extends AbstractModule
implements IAsynchronousModule, IParameterized

abstract asynchronous module. Those wishing to add additional parameters should extends getSetableParameters()

Author:
harrison

Field Summary
 
Fields inherited from interface org.jactr.core.module.asynch.IAsynchronousModule
STRICT_SYNCHRONIZATION_PARAM
 
Constructor Summary
AbstractAsynchronousModule(java.lang.String name)
           
 
Method Summary
 java.lang.String getParameter(java.lang.String key)
          return parameter value - null if not defined.
 java.util.Collection<java.lang.String> getPossibleParameters()
          Return all parameters that can be read
 java.util.Collection<java.lang.String> getSetableParameters()
          Return list of all parameters that can be set.
 boolean isStrictSynchronizationEnabled()
           
 void setParameter(java.lang.String key, java.lang.String value)
          Set the named parameter
 void setStrictSynchronizationEnabled(boolean enableStrict)
           
 BlockingTimedEvent synchronizedTimedEvent(double startTime, double blockAtTime)
          create a new synchronization point.
 
Methods inherited from class org.jactr.core.module.AbstractModule
delayedFuture, dispose, getExecutor, getModel, getName, immediateFuture, immediateReturn, initialize, install, uninstall
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jactr.core.module.asynch.IAsynchronousModule
getExecutor
 
Methods inherited from interface org.jactr.core.module.IModule
dispose, getModel, getName, initialize, install, reset
 
Methods inherited from interface org.jactr.core.utils.IInstallable
uninstall
 

Constructor Detail

AbstractAsynchronousModule

public AbstractAsynchronousModule(java.lang.String name)
Method Detail

isStrictSynchronizationEnabled

public boolean isStrictSynchronizationEnabled()
Specified by:
isStrictSynchronizationEnabled in interface IAsynchronousModule

setStrictSynchronizationEnabled

public void setStrictSynchronizationEnabled(boolean enableStrict)
Specified by:
setStrictSynchronizationEnabled in interface IAsynchronousModule

synchronizedTimedEvent

public BlockingTimedEvent synchronizedTimedEvent(double startTime,
                                                 double blockAtTime)
Description copied from interface: IAsynchronousModule
create a new synchronization point. This synchronization point will block the model from further firing at blockAtTime. The block will not be released until BlockingTimedEvent.abort() is called.

If IAsynchronousModule.isStrictSynchronizationEnabled() is true, the event will be created and queued. If false, the event will be created, immediately aborted, and not queued.

This behavior was decided upon so that the module code need not concern itself with IAsynchronousModule.isStrictSynchronizationEnabled() at all. Modules that wish to synchronize should just create the BlockingTimedEvent via this call and make their module request. Upon completion of the request, the block is aborted.

Specified by:
synchronizedTimedEvent in interface IAsynchronousModule
Returns:

getSetableParameters

public java.util.Collection<java.lang.String> getSetableParameters()
Description copied from interface: IParameterized
Return list of all parameters that can be set.

Specified by:
getSetableParameters in interface IParameterized
Returns:
The setableParameters value

getPossibleParameters

public java.util.Collection<java.lang.String> getPossibleParameters()
Description copied from interface: IParameterized
Return all parameters that can be read

Specified by:
getPossibleParameters in interface IParameterized
Returns:
The possibleParameters value

setParameter

public void setParameter(java.lang.String key,
                         java.lang.String value)
Description copied from interface: IParameterized
Set the named parameter

Specified by:
setParameter in interface IParameterized

getParameter

public java.lang.String getParameter(java.lang.String key)
Description copied from interface: IParameterized
return parameter value - null if not defined.

Specified by:
getParameter in interface IParameterized
Parameters:
key - Description of the Parameter
Returns:
The parameter value