barsuift.simLife.process
Interface SynchronizerCore

All Superinterfaces:
Persistent<SynchronizerCoreState>, Publisher, Subscriber, Synchronizer, TaskSynchronizer<ConditionalTask>

public interface SynchronizerCore
extends TaskSynchronizer<ConditionalTask>, Persistent<SynchronizerCoreState>

The core synchronizer allows to run a list of given ConditionalTask at a given rate.


Field Summary
 
Fields inherited from interface barsuift.simLife.process.Synchronizer
CYCLE_LENGTH_3D_MS, CYCLE_LENGTH_CORE_MS
 
Method Summary
 Speed getSpeed()
          Returns the speed of the core synchronizer.
 void schedule(ConditionalTask task)
          Adds the given task to the list of synchronized tasks.
 void setBarrier(java.util.concurrent.CyclicBarrier barrier)
          Set the barrier to use for synchronization purpose.
 void setSpeed(Speed speed)
          Sets the speed of the current core synchronizer.
 void unschedule(ConditionalTask task)
          Remove the given task from the list of synchronized tasks.
 
Methods inherited from interface barsuift.simLife.process.Synchronizer
isRunning, start, stop
 
Methods inherited from interface barsuift.simLife.message.Publisher
addSubscriber, clearChanged, countSubscribers, deleteSubscriber, deleteSubscribers, hasChanged, notifySubscribers, notifySubscribers, setChanged
 
Methods inherited from interface barsuift.simLife.message.Subscriber
update
 
Methods inherited from interface barsuift.simLife.Persistent
getState, synchronize
 

Method Detail

setSpeed

void setSpeed(Speed speed)
Sets the speed of the current core synchronizer.

Parameters:
speed - the speed

getSpeed

Speed getSpeed()
Returns the speed of the core synchronizer.

Returns:
the speed of the synchronizer

schedule

void schedule(ConditionalTask task)
Adds the given task to the list of synchronized tasks.

Specified by:
schedule in interface TaskSynchronizer<ConditionalTask>
Parameters:
task - the task to synchronize

unschedule

void unschedule(ConditionalTask task)
Remove the given task from the list of synchronized tasks.

Specified by:
unschedule in interface TaskSynchronizer<ConditionalTask>
Parameters:
task - the task to desynchronize

setBarrier

void setBarrier(java.util.concurrent.CyclicBarrier barrier)
Set the barrier to use for synchronization purpose.

Parameters:
barrier - the cyclic barrier used to synchronize the synchronizer with other synchronizers
Throws:
java.lang.IllegalArgumentException - if the given barrier is null
java.lang.IllegalStateException - if a barrier has already been set


Copyright © 2010. All Rights Reserved.