Package org.apache.jackrabbit.util
Class LockedWrapper<T>
- java.lang.Object
 - 
- org.apache.jackrabbit.util.Locked
 - 
- org.apache.jackrabbit.util.LockedWrapper<T>
 
 
 
- 
- 
Constructor Summary
Constructors Constructor Description LockedWrapper() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Twith(javax.jcr.Node lockable, boolean isDeep)ExecutesLocked.run(javax.jcr.Node)while the lock onlockableis held.Twith(javax.jcr.Node lockable, boolean isDeep, boolean isSessionScoped)ExecutesLocked.run(javax.jcr.Node)while the lock onlockableis held.Twith(javax.jcr.Node lockable, boolean isDeep, long timeout)Executes the methodLocked.run(javax.jcr.Node)within the scope of a lock held onlockable.java.lang.Objectwith(javax.jcr.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(javax.jcr.Node lockable, boolean isDeep) throws javax.jcr.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:
 javax.jcr.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(javax.jcr.Node lockable, boolean isDeep, boolean isSessionScoped) throws javax.jcr.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:
 javax.jcr.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(javax.jcr.Node lockable, boolean isDeep, long timeout) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.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:
 javax.jcr.UnsupportedRepositoryOperationException- if this repository does not support locking.javax.jcr.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(javax.jcr.Node lockable, boolean isDeep, long timeout, boolean isSessionScoped) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException, java.lang.InterruptedExceptionDescription 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:
 javax.jcr.UnsupportedRepositoryOperationException- if this repository does not support locking.javax.jcr.RepositoryException- ifLocked.run(javax.jcr.Node)throws an exception.java.lang.InterruptedException- if this thread is interrupted while waiting for the lock on nodelockable.
 
 - 
 
 -