Class LockableAspectInterceptor

  • All Implemented Interfaces:
    Extensible, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

    public class LockableAspectInterceptor
    extends java.lang.Object
    implements org.aopalliance.intercept.MethodInterceptor, Extensible
    NodeService interceptor to spoof the cm:lockable aspect when reading a node that has an ephemeral lock on it. LockService policies such as beforeDeleteNode that protect locked nodes, would not fire for nodes with ephemeral locks on them unless they are reported to have the cm:lockable aspect on them. As ephemeral locks are only held in memory the nodes have not been marked with this aspect, so the aspect must be spoofed.

    This interceptor checks for EPHEMERAL lock directly - MNT-10477 fix.

    Author:
    Matt Ward
    • Constructor Detail

      • LockableAspectInterceptor

        public LockableAspectInterceptor()
        Default constructor.
    • Method Detail

      • init

        public void init()
      • invoke

        public java.lang.Object invoke​(org.aopalliance.intercept.MethodInvocation invocation)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface org.aopalliance.intercept.MethodInterceptor
        Throws:
        java.lang.Throwable
      • enableForThread

        public void enableForThread()
        Enables the interceptor for the current thread. This would normally be used in a finally block to re-enable the interceptor for a previously disabled thread.
      • disableForThread

        public void disableForThread()
        Disables the interceptor for the current thread. Follow with a try/finally block as described for enableForThread().
      • setLockStore

        public void setLockStore​(LockStore lockStore)
      • setAuthenticationService

        public void setAuthenticationService​(AuthenticationService authenticationService)
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      • setLockService

        public void setLockService​(LockService lockService)