Package org.alfresco.repo.lock.mem
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 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 Summary
Constructors Constructor Description LockableAspectInterceptor()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableForThread()Disables the interceptor for the current thread.voidenableForThread()Enables the interceptor for the current thread.<T extends Trait>
ExtendedTrait<T>getTrait(java.lang.Class<? extends T> traitAPI)voidinit()java.lang.Objectinvoke(org.aopalliance.intercept.MethodInvocation invocation)voidsetAuthenticationService(AuthenticationService authenticationService)voidsetLockService(LockService lockService)voidsetLockStore(LockStore lockStore)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
-
-
Method Detail
-
init
public void init()
-
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable- Specified by:
invokein interfaceorg.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 previouslydisabledthread.
-
disableForThread
public void disableForThread()
Disables the interceptor for the current thread. Follow with a try/finally block as described forenableForThread().
-
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)
-
getTrait
public <T extends Trait> ExtendedTrait<T> getTrait(java.lang.Class<? extends T> traitAPI)
- Specified by:
getTraitin interfaceExtensible
-
-