org.infinispan.remoting.transport.jgroups
Class JGroupsDistSync

java.lang.Object
  extended by org.infinispan.remoting.transport.jgroups.JGroupsDistSync
All Implemented Interfaces:
DistributedSync

@ThreadSafe
public class JGroupsDistSync
extends Object
implements DistributedSync

A DistributedSync based on JGroups' FLUSH protocol

Since:
4.0
Author:
Manik Surtani

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.infinispan.remoting.transport.DistributedSync
DistributedSync.SyncResponse
 
Field Summary
static boolean trace
           
 
Constructor Summary
JGroupsDistSync()
           
 
Method Summary
 void acquireProcessingLock(boolean exclusive, long timeout, TimeUnit timeUnit)
          Acquires a processing lock.
 void acquireSync()
          Acquires the sync.
 DistributedSync.SyncResponse blockUntilAcquired(long timeout, TimeUnit timeUnit)
          Blocks until the start of a sync - either by the current RPCManager instance or a remote one - is received.
 void blockUntilNoJoinsInProgress()
           
 DistributedSync.SyncResponse blockUntilReleased(long timeout, TimeUnit timeUnit)
          Blocks until an ongoing sync ends.
 void releaseProcessingLock()
          Releases any processing locks that may be held by the current thread.
 void releaseSync()
          Releases the sync.
 void signalJoinCompleted()
           
 void signalJoinInProgress()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trace

public static final boolean trace
Constructor Detail

JGroupsDistSync

public JGroupsDistSync()
Method Detail

blockUntilNoJoinsInProgress

public void blockUntilNoJoinsInProgress()
                                 throws InterruptedException
Throws:
InterruptedException

blockUntilAcquired

public DistributedSync.SyncResponse blockUntilAcquired(long timeout,
                                                       TimeUnit timeUnit)
                                                throws TimeoutException,
                                                       InterruptedException
Description copied from interface: DistributedSync
Blocks until the start of a sync - either by the current RPCManager instance or a remote one - is received. This should return immediately if sync is already in progress.

Specified by:
blockUntilAcquired in interface DistributedSync
Parameters:
timeout - timeout after which to give up
timeUnit - time unit
Throws:
TimeoutException - if waiting for the sync times out.
InterruptedException

blockUntilReleased

public DistributedSync.SyncResponse blockUntilReleased(long timeout,
                                                       TimeUnit timeUnit)
                                                throws TimeoutException,
                                                       InterruptedException
Description copied from interface: DistributedSync
Blocks until an ongoing sync ends. This is returns immediately if there is no ongoing sync.

Specified by:
blockUntilReleased in interface DistributedSync
Parameters:
timeout - timeout after which to give up
timeUnit - time unit
Throws:
TimeoutException - if waiting for an ongoing sync to end times out.
InterruptedException

acquireSync

public void acquireSync()
Description copied from interface: DistributedSync
Acquires the sync. This could be from a local or remote source.

Specified by:
acquireSync in interface DistributedSync

releaseSync

public void releaseSync()
Description copied from interface: DistributedSync
Releases the sync. This could be from a local or remote source.

Specified by:
releaseSync in interface DistributedSync

acquireProcessingLock

public void acquireProcessingLock(boolean exclusive,
                                  long timeout,
                                  TimeUnit timeUnit)
                           throws InterruptedException,
                                  TimeoutException
Description copied from interface: DistributedSync
Acquires a processing lock. This is typically acquired after the sync is acquired, and is meant for local (not remote) use.

Specified by:
acquireProcessingLock in interface DistributedSync
Parameters:
exclusive - whether the lock is exclusive
timeout - timeout after which to give up
timeUnit - time unit
Throws:
TimeoutException - if waiting for the lock times out
InterruptedException

releaseProcessingLock

public void releaseProcessingLock()
Description copied from interface: DistributedSync
Releases any processing locks that may be held by the current thread.

Specified by:
releaseProcessingLock in interface DistributedSync

signalJoinInProgress

public void signalJoinInProgress()

signalJoinCompleted

public void signalJoinCompleted()

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.