info.magnolia.context
Class MgnlContext.LockingOp

java.lang.Object
  extended by info.magnolia.context.MgnlContext.RepositoryOp
      extended by info.magnolia.context.MgnlContext.LockingOp
All Implemented Interfaces:
MgnlContext.Op<Void,javax.jcr.RepositoryException>
Enclosing class:
MgnlContext

public abstract static class MgnlContext.LockingOp
extends MgnlContext.RepositoryOp

Operation that is performed only if JCR lock can be issued on the path specified by combination of parameters in constructor. Lock issued and held by this operation prevents other concurrent modifications and should not be used without reason. Locking is always session scoped, meaning that is issuing session is closed, any locks held by the session are forcefully released at this point. Since Magnolia uses request scoped sessions in most cases, it means that no matter what happens lock will be released latest when request processing is finished.


Constructor Summary
MgnlContext.LockingOp(String workspaceName, String lockPath)
          Performs operation only if shallow lock can be obtained within reasonable time on a path specified by params.
MgnlContext.LockingOp(String workspaceName, String lockPath, boolean deepLock)
          Performs operation only if shallow or deep lock can be obtained within reasonable time on a path specified by params.
MgnlContext.LockingOp(String workspaceName, String lockPath, boolean deepLock, String nodeType)
          Performs operation only if shallow or deep lock can be obtained within reasonable time on a path specified by params.
MgnlContext.LockingOp(String workspaceName, String lockPath, boolean deepLock, String lockedNodeType, String userName)
          Performs operation only if shallow or deep lock can be obtained within reasonable time on a path specified by params.
MgnlContext.LockingOp(String workspaceName, String lockPath, String nodeType)
          Performs operation only if shallow lock can be obtained within reasonable time on a path specified by params.
 
Method Summary
 Void exec()
           
 
Methods inherited from class info.magnolia.context.MgnlContext.RepositoryOp
doExec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MgnlContext.LockingOp

public MgnlContext.LockingOp(String workspaceName,
                             String lockPath)
Performs operation only if shallow lock can be obtained within reasonable time on a path specified by params.


MgnlContext.LockingOp

public MgnlContext.LockingOp(String workspaceName,
                             String lockPath,
                             boolean deepLock)
Performs operation only if shallow or deep lock can be obtained within reasonable time on a path specified by params. Use deep locking with care as it will stop all other locking operations all the way down your tree structure. Obtaining and releasing deep lock is also more expensive then shallow locking.


MgnlContext.LockingOp

public MgnlContext.LockingOp(String workspaceName,
                             String lockPath,
                             String nodeType)
Performs operation only if shallow lock can be obtained within reasonable time on a path specified by params. If node at specified path is not of specified primary type, this action will attempt to locate and lock nearest parent node that is of specified type. Failing to locate such node, lock will be issued on the specified path itself.


MgnlContext.LockingOp

public MgnlContext.LockingOp(String workspaceName,
                             String lockPath,
                             boolean deepLock,
                             String nodeType)
Performs operation only if shallow or deep lock can be obtained within reasonable time on a path specified by params. If node at specified path is not of specified primary type, this action will attempt to locate and lock nearest parent node that is of specified type. Failing to locate such node, lock will be issued on the specified path itself. Use deep locking with care as it will stop all other locking operations all the way down your tree structure. Obtaining and releasing deep lock is also more expensive then shallow locking.


MgnlContext.LockingOp

public MgnlContext.LockingOp(String workspaceName,
                             String lockPath,
                             boolean deepLock,
                             String lockedNodeType,
                             String userName)
Performs operation only if shallow or deep lock can be obtained within reasonable time on a path specified by params. If node at specified path is not of specified primary type, this action will attempt to locate and lock nearest parent node that is of specified type. Failing to locate such node, lock will be issued on the specified path itself. Use deep locking with care as it will stop all other locking operations all the way down your tree structure. Obtaining and releasing deep lock is also more expensive then shallow locking. Specify a user name to be used in lock description in case this operation should be assigned to other user then one currently logged in (doesn't have any effect on permissions, information is stored for debugging and troubleshooting purposes only).

Method Detail

exec

public Void exec()
          throws javax.jcr.RepositoryException
Specified by:
exec in interface MgnlContext.Op<Void,javax.jcr.RepositoryException>
Overrides:
exec in class MgnlContext.RepositoryOp
Throws:
javax.jcr.RepositoryException


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.