org.objectweb.transaction.api.lock
Interface ExclusiveLockFeature

All Superinterfaces:
Feature, ReleaseLockFeature

public interface ExclusiveLockFeature
extends ReleaseLockFeature

Definition of an exclusive Lock.

Version:
0.1
Author:
Romain Rouvoy
ADL:
name="EXCLUSIVE_LOCK_FEATURE" value="exclusive-lock-feature"

Field Summary
static java.lang.String EXCLUSIVE_LOCK_FEATURE
          ADL Identifier
 
Fields inherited from interface org.objectweb.transaction.api.lock.ReleaseLockFeature
RELEASE_LOCK_FEATURE
 
Fields inherited from interface org.objectweb.transaction.api.Feature
FEATURE
 
Method Summary
 void acquire(LockIdentifier id)
          Acquire the Lock.
 boolean isAcquired(LockIdentifier id)
          Check if the Lock is acquired.
 boolean tryAcquire(LockIdentifier id)
          Try to acquire the Lock.
 
Methods inherited from interface org.objectweb.transaction.api.lock.ReleaseLockFeature
release
 

Field Detail

EXCLUSIVE_LOCK_FEATURE

public static final java.lang.String EXCLUSIVE_LOCK_FEATURE
ADL Identifier

See Also:
Constant Field Values
Method Detail

acquire

public void acquire(LockIdentifier id)
Acquire the Lock. If the Lock is not available, the method wait for the release of the Lock

Parameters:
id - - the lock requester

tryAcquire

public boolean tryAcquire(LockIdentifier id)
Try to acquire the Lock. This is a non-blocking method.

Parameters:
id - - the lock requester
Returns:
true if the lock is acquired - false if the lock can not be acquired.

isAcquired

public boolean isAcquired(LockIdentifier id)
Check if the Lock is acquired.

Parameters:
id - - the lock requester
Returns:
true if the lock is currently acquired - false if the lock is not acquired.