org.jgroups.protocols
Class Locking.ClientLock

java.lang.Object
  extended by org.jgroups.protocols.Locking.ClientLock
All Implemented Interfaces:
java.util.concurrent.locks.Lock
Direct Known Subclasses:
PEER_LOCK.PeerLock
Enclosing class:
Locking

protected class Locking.ClientLock
extends java.lang.Object
implements java.util.concurrent.locks.Lock


Field Summary
protected  boolean acquired
           
protected  Locking.ClientCondition condition
           
protected  boolean denied
           
protected  boolean is_trylock
           
protected  java.lang.String name
           
protected  Owner owner
           
protected  long timeout
           
 
Constructor Summary
Locking.ClientLock(java.lang.String name)
           
 
Method Summary
protected  void _unlock(boolean force)
           
protected  void acquire(boolean throwInterrupt)
           
protected  boolean acquireTryLock(long timeout, boolean use_timeout)
           
protected  void handleLockGrantedResponse(Owner owner, Address sender)
           
 void lock()
           
protected  void lockDenied()
           
protected  void lockGranted()
           
 void lockInterruptibly()
           
 java.util.concurrent.locks.Condition newCondition()
           
 java.lang.String toString()
           
 boolean tryLock()
           
 boolean tryLock(long time, java.util.concurrent.TimeUnit unit)
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected final java.lang.String name

owner

protected Owner owner

acquired

protected volatile boolean acquired

denied

protected volatile boolean denied

is_trylock

protected volatile boolean is_trylock

timeout

protected long timeout

condition

protected final Locking.ClientCondition condition
Constructor Detail

Locking.ClientLock

public Locking.ClientLock(java.lang.String name)
Method Detail

lock

public void lock()
Specified by:
lock in interface java.util.concurrent.locks.Lock

lockInterruptibly

public void lockInterruptibly()
                       throws java.lang.InterruptedException
Specified by:
lockInterruptibly in interface java.util.concurrent.locks.Lock
Throws:
java.lang.InterruptedException

tryLock

public boolean tryLock()
Specified by:
tryLock in interface java.util.concurrent.locks.Lock

tryLock

public boolean tryLock(long time,
                       java.util.concurrent.TimeUnit unit)
                throws java.lang.InterruptedException
Specified by:
tryLock in interface java.util.concurrent.locks.Lock
Throws:
java.lang.InterruptedException

unlock

public void unlock()
Specified by:
unlock in interface java.util.concurrent.locks.Lock

newCondition

public java.util.concurrent.locks.Condition newCondition()
Specified by:
newCondition in interface java.util.concurrent.locks.Lock

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

lockGranted

protected void lockGranted()

lockDenied

protected void lockDenied()

handleLockGrantedResponse

protected void handleLockGrantedResponse(Owner owner,
                                         Address sender)

acquire

protected void acquire(boolean throwInterrupt)
                throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

_unlock

protected void _unlock(boolean force)

acquireTryLock

protected boolean acquireTryLock(long timeout,
                                 boolean use_timeout)
                          throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.