|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.lock.XALockManager
public class XALockManager
Session-local lock manager that implements the semantical changes inside transactions. This manager validates lock/unlock operations inside its view of the locking space.
| Constructor Summary | |
|---|---|
XALockManager(LockManagerImpl lockMgr)
Create a new instance of this class. |
|
| Method Summary | |
|---|---|
void |
afterOperation(TransactionContext tx)
Invoked after one of the InternalXAResource.prepare(org.apache.jackrabbit.core.TransactionContext), InternalXAResource.commit(org.apache.jackrabbit.core.TransactionContext) or
InternalXAResource.rollback(org.apache.jackrabbit.core.TransactionContext) method has been called. |
void |
associate(TransactionContext tx)
Associate this resource with a transaction. |
void |
beforeOperation(TransactionContext tx)
Invoked before one of the InternalXAResource.prepare(org.apache.jackrabbit.core.TransactionContext), InternalXAResource.commit(org.apache.jackrabbit.core.TransactionContext) or
InternalXAResource.rollback(org.apache.jackrabbit.core.TransactionContext) method is called. |
void |
checkLock(NodeImpl node)
Check whether the node given is locked by somebody else than the current session. |
void |
checkLock(Path path,
javax.jcr.Session session)
Check whether the path given is locked by somebody else than the session described. |
void |
commit(TransactionContext tx)
Commit transaction. |
boolean |
differentXAEnv(AbstractLockInfo info)
Return a flag indicating whether a lock info belongs to a different XA environment. |
javax.jcr.lock.Lock |
getLock(NodeImpl node)
Returns the Lock object that applies to a node. |
javax.jcr.lock.Lock[] |
getLocks(SessionImpl session)
Returns all locks owned by the specified session. |
boolean |
holdsLock(NodeImpl node)
Returns true if the node given holds a lock;
otherwise returns false. |
boolean |
isLocked(NodeImpl node)
Returns true if this node is locked either as a result
of a lock held by this node or by a deep lock on a node above this
node; otherwise returns false |
boolean |
isLockHolder(javax.jcr.Session session,
NodeImpl node)
Returns true if the specified session holds a lock on the
given node; otherwise returns false. |
javax.jcr.lock.Lock |
lock(NodeImpl node,
boolean isDeep,
boolean isSessionScoped)
Lock a node. |
void |
lockTokenAdded(SessionImpl session,
java.lang.String lt)
Invoked by a session to inform that a lock token has been added. |
void |
lockTokenRemoved(SessionImpl session,
java.lang.String lt)
Invoked by a session to inform that a lock token has been removed. |
void |
prepare(TransactionContext tx)
Prepare transaction. |
void |
rollback(TransactionContext tx)
Rollback transaction. |
void |
unlock(NodeImpl node)
Removes the lock on a node given by its path. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XALockManager(LockManagerImpl lockMgr)
lockMgr - lockMgr global lock manager| Method Detail |
|---|
public javax.jcr.lock.Lock lock(NodeImpl node,
boolean isDeep,
boolean isSessionScoped)
throws javax.jcr.lock.LockException,
javax.jcr.RepositoryException
lock in interface LockManagernode - nodeisDeep - whether the lock applies to this node onlyisSessionScoped - whether the lock is session scoped
javax.jcr.lock.LockException - if this node already is locked, or some descendant
node is locked and isDeep is true
javax.jcr.RepositoryExceptionNode.lock(boolean, boolean)
public javax.jcr.lock.Lock getLock(NodeImpl node)
throws javax.jcr.lock.LockException,
javax.jcr.RepositoryException
getLock in interface LockManagernode - node
javax.jcr.lock.LockException - if this node is not locked
javax.jcr.RepositoryExceptionNode.getLock()
public javax.jcr.lock.Lock[] getLocks(SessionImpl session)
throws javax.jcr.RepositoryException
getLocks in interface LockManagersession - session
javax.jcr.RepositoryException - if an error occursSessionImpl.getLocks()
public void unlock(NodeImpl node)
throws javax.jcr.lock.LockException,
javax.jcr.RepositoryException
unlock in interface LockManagernode - node
javax.jcr.lock.LockException - if this node is not locked or the session
does not have the correct lock token
javax.jcr.RepositoryExceptionNode.unlock()
public boolean holdsLock(NodeImpl node)
throws javax.jcr.RepositoryException
true if the node given holds a lock;
otherwise returns false.
holdsLock in interface LockManagernode - node
true if the node given holds a lock;
otherwise returns false
javax.jcr.RepositoryExceptionNode.holdsLock()
public boolean isLockHolder(javax.jcr.Session session,
NodeImpl node)
throws javax.jcr.RepositoryException
true if the specified session holds a lock on the
given node; otherwise returns false.
Note that isLockHolder(session, node)==true implies
holdsLock(node)==true.
isLockHolder in interface LockManagersession - sessionnode - node
false
javax.jcr.RepositoryException
public boolean isLocked(NodeImpl node)
throws javax.jcr.RepositoryException
true if this node is locked either as a result
of a lock held by this node or by a deep lock on a node above this
node; otherwise returns false
isLocked in interface LockManagernode - node
true if this node is locked either as a result
of a lock held by this node or by a deep lock on a node above this
node; otherwise returns false
javax.jcr.RepositoryExceptionNode.isLocked()
public void checkLock(NodeImpl node)
throws javax.jcr.lock.LockException,
javax.jcr.RepositoryException
checkLock in interface LockManagernode - node to check
javax.jcr.lock.LockException - if write access to the specified node is not allowed
javax.jcr.RepositoryException - if some other error occurs
public void checkLock(Path path,
javax.jcr.Session session)
throws javax.jcr.lock.LockException,
javax.jcr.RepositoryException
checkLock in interface LockManagerpath - path to checksession - session
javax.jcr.lock.LockException - if write access to the specified path is not allowed
javax.jcr.RepositoryException - if some other error occurs
public void lockTokenAdded(SessionImpl session,
java.lang.String lt)
lockTokenAdded in interface LockManagersession - session that has a added lock tokenlt - added lock token
public void lockTokenRemoved(SessionImpl session,
java.lang.String lt)
lockTokenRemoved in interface LockManagersession - session that has a removed lock tokenlt - removed lock tokenpublic void associate(TransactionContext tx)
associate in interface InternalXAResourcetx - transaction context, if null disassociatepublic void beforeOperation(TransactionContext tx)
InternalXAResource.prepare(org.apache.jackrabbit.core.TransactionContext), InternalXAResource.commit(org.apache.jackrabbit.core.TransactionContext) or
InternalXAResource.rollback(org.apache.jackrabbit.core.TransactionContext) method is called.
beforeOperation in interface InternalXAResourcetx - transaction context
public void prepare(TransactionContext tx)
throws TransactionException
prepare in interface InternalXAResourcetx - transaction context
TransactionException - if an error occurspublic void commit(TransactionContext tx)
commit in interface InternalXAResourcetx - transaction contextpublic void rollback(TransactionContext tx)
rollback in interface InternalXAResourcetx - transaction context.public void afterOperation(TransactionContext tx)
InternalXAResource.prepare(org.apache.jackrabbit.core.TransactionContext), InternalXAResource.commit(org.apache.jackrabbit.core.TransactionContext) or
InternalXAResource.rollback(org.apache.jackrabbit.core.TransactionContext) method has been called.
afterOperation in interface InternalXAResourcetx - transaction contextpublic boolean differentXAEnv(AbstractLockInfo info)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||