Package org.apache.jackrabbit.util
Class LockedWrapper<T>
- java.lang.Object
 - 
- org.apache.jackrabbit.util.Locked
 - 
- org.apache.jackrabbit.util.LockedWrapper<T>
 
 
 
- 
public abstract class LockedWrapper<T> extends Locked
LockedWrapperis a wrapper class toLockedwhich adds generics support and wraps theLocked.TIMED_OUTobject into aLockException. 
- 
- 
Constructor Summary
Constructors Constructor Description LockedWrapper() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Twith(Node lockable, boolean isDeep)ExecutesLocked.run(javax.jcr.Node)while the lock onlockableis held.Twith(Node lockable, boolean isDeep, boolean isSessionScoped)ExecutesLocked.run(javax.jcr.Node)while the lock onlockableis held.Twith(Node lockable, boolean isDeep, long timeout)Executes the methodLocked.run(javax.jcr.Node)within the scope of a lock held onlockable.java.lang.Objectwith(Node lockable, boolean isDeep, long timeout, boolean isSessionScoped)Executes the methodLocked.run(javax.jcr.Node)within the scope of a lock held onlockable. 
 - 
 
- 
- 
Method Detail
- 
with
public T with(Node lockable, boolean isDeep) throws RepositoryException, java.lang.InterruptedException
Description copied from class:LockedExecutesLocked.run(javax.jcr.Node)while the lock onlockableis held. This method will block untilLocked.run(javax.jcr.Node)is executed while holding the lock on nodelockable.- Overrides:
 within classLocked- Parameters:
 lockable- a lockable node.isDeep-trueiflockablewill be locked deep.- Returns:
 - the object returned by 
Locked.run(javax.jcr.Node). - Throws:
 RepositoryException- ifLocked.run(javax.jcr.Node)throws an exception.java.lang.InterruptedException- if this thread is interrupted while waiting for the lock on nodelockable.
 
- 
with
public T with(Node lockable, boolean isDeep, boolean isSessionScoped) throws RepositoryException, java.lang.InterruptedException
Description copied from class:LockedExecutesLocked.run(javax.jcr.Node)while the lock onlockableis held. This method will block untilLocked.run(javax.jcr.Node)is executed while holding the lock on nodelockable.- Overrides:
 within classLocked- Parameters:
 lockable- a lockable node.isDeep-trueiflockablewill be locked deep.isSessionScoped-trueif the lock is session scoped.- Returns:
 - the object returned by 
Locked.run(javax.jcr.Node). - Throws:
 RepositoryException- ifLocked.run(javax.jcr.Node)throws an exception.java.lang.InterruptedException- if this thread is interrupted while waiting for the lock on nodelockable.
 
- 
with
public T with(Node lockable, boolean isDeep, long timeout) throws UnsupportedRepositoryOperationException, RepositoryException, java.lang.InterruptedException
Description copied from class:LockedExecutes the methodLocked.run(javax.jcr.Node)within the scope of a lock held onlockable.- Overrides:
 within classLocked- Parameters:
 lockable- the node where the lock is obtained from.isDeep-trueiflockablewill be locked deep.timeout- time in milliseconds to wait at most to acquire the lock.- Returns:
 - the object returned by 
Locked.run(javax.jcr.Node)orLocked.TIMED_OUTif the lock onlockablecould not be acquired within the specified timeout. - Throws:
 UnsupportedRepositoryOperationException- if this repository does not support locking.RepositoryException- ifLocked.run(javax.jcr.Node)throws an exception.java.lang.InterruptedException- if this thread is interrupted while waiting for the lock on nodelockable.
 
- 
with
public java.lang.Object with(Node lockable, boolean isDeep, long timeout, boolean isSessionScoped) throws UnsupportedRepositoryOperationException, RepositoryException, java.lang.InterruptedException
Description copied from class:LockedExecutes the methodLocked.run(javax.jcr.Node)within the scope of a lock held onlockable.- Overrides:
 within classLocked- Parameters:
 lockable- the node where the lock is obtained from.isDeep-trueiflockablewill be locked deep.timeout- time in milliseconds to wait at most to acquire the lock.isSessionScoped-trueif the lock is session scoped.- Returns:
 - the object returned by 
Locked.run(javax.jcr.Node)orLocked.TIMED_OUTif the lock onlockablecould not be acquired within the specified timeout. - Throws:
 UnsupportedRepositoryOperationException- if this repository does not support locking.RepositoryException- ifLocked.run(javax.jcr.Node)throws an exception.java.lang.InterruptedException- if this thread is interrupted while waiting for the lock on nodelockable.
 
 - 
 
 -