Class LockableAspectInterceptor

java.lang.Object
org.alfresco.repo.lock.mem.LockableAspectInterceptor
All Implemented Interfaces:
Extensible, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class LockableAspectInterceptor extends 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 Details

    • LockableAspectInterceptor

      public LockableAspectInterceptor()
      Default constructor.
  • Method Details

    • init

      public void init()
    • invoke

      public Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Throws:
      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(NodeService nodeService)
    • setLockService

      public void setLockService(LockService lockService)
    • getTrait

      public <T extends Trait> ExtendedTrait<T> getTrait(Class<? extends T> traitAPI)
      Specified by:
      getTrait in interface Extensible