org.olat.commons.coordinate.cluster
Class ClusterSyncer

java.lang.Object
  extended by org.olat.commons.coordinate.cluster.ClusterSyncer
All Implemented Interfaces:
Syncer

public class ClusterSyncer
extends java.lang.Object
implements Syncer

Description:
cluster mode implementation of the Syncer

Initial Date: 21.09.2007

Author:
Felix Jost, http://www.goodsolutions.ch

Constructor Summary
ClusterSyncer()
           
 
Method Summary
 void assertAlreadyDoInSyncFor(OLATResourceable ores)
          Check if already in synchronized block for certain olat-resource
<T> T
doInSync(OLATResourceable ores, SyncerCallback<T> callback)
          guarantees that the code r is running serialized in regard to other code with the same resourceable
 void doInSync(OLATResourceable ores, SyncerExecutor executor)
          same as doInSync(OLATResourceable ores, SyncerCallback action), but without return object.
 void setExecutionTimeThreshold(int executionTimeThreshold)
          [used by spring]
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterSyncer

public ClusterSyncer()
Method Detail

doInSync

public <T> T doInSync(OLATResourceable ores,
                      SyncerCallback<T> callback)
Description copied from interface: Syncer
guarantees that the code r is running serialized in regard to other code with the same resourceable

Specified by:
doInSync in interface Syncer
Parameters:
ores - the resourceable to sync upon
callback - 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.
See Also:
Syncer.doInSync(org.olat.core.id.OLATResourceable, org.olat.core.util.coordinate.SyncerCallback)

doInSync

public void doInSync(OLATResourceable ores,
                     SyncerExecutor executor)
Description copied from interface: Syncer
same as doInSync(OLATResourceable ores, SyncerCallback action), but without return object.

Specified by:
doInSync in interface Syncer
See Also:
Syncer.doInSync(org.olat.core.id.OLATResourceable, org.olat.core.util.coordinate.SyncerExecutor)

assertAlreadyDoInSyncFor

public void assertAlreadyDoInSyncFor(OLATResourceable ores)
Description copied from interface: Syncer
Check if already in synchronized block for certain olat-resource

Specified by:
assertAlreadyDoInSyncFor in interface Syncer
See Also:
Syncer.assertAlreadyDoInSyncFor(org.olat.core.id.OLATResourceable)

setExecutionTimeThreshold

public void setExecutionTimeThreshold(int executionTimeThreshold)
[used by spring]

Parameters:
executionTimeThreshold -