org.olat.core.util.coordinate
Interface Syncer

All Known Implementing Classes:
ClusterSyncer, SingleVMSyncer

public interface Syncer

Description:
interface for synchronizing access to protected regions

Initial Date: 17.09.2007

Author:
felix

Method Summary
 void assertAlreadyDoInSyncFor(OLATResourceable ores)
          Check if already in synchronized block for certain olat-resource
<T> T
doInSync(OLATResourceable ores, SyncerCallback<T> action)
          guarantees that the code r is running serialized in regard to other code with the same resourceable
 void doInSync(OLATResourceable ores, SyncerExecutor action)
          same as doInSync(OLATResourceable ores, SyncerCallback action), but without return object.
 

Method Detail

doInSync

<T> T doInSync(OLATResourceable ores,
               SyncerCallback<T> action)
guarantees that the code r is running serialized in regard to other code with the same resourceable

Parameters:
ores - the resourceable to sync upon
action - the code to be executed in the protected region (it is executed synchronously, that is, within the same thread as the caller of this method)
Returns:
the Object that the SynceCallback returns (may be null). This can used to transfer results back to the caller.

doInSync

void doInSync(OLATResourceable ores,
              SyncerExecutor action)
same as doInSync(OLATResourceable ores, SyncerCallback action), but without return object.

Parameters:
ores -
action -

assertAlreadyDoInSyncFor

void assertAlreadyDoInSyncFor(OLATResourceable ores)
Check if already in synchronized block for certain olat-resource

Parameters:
ores -