org.dellroad.stuff.servlet
Class BigFatLockHeldAdvice
java.lang.Object
org.springframework.aop.aspectj.AbstractAspectJAdvice
org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
org.dellroad.stuff.servlet.BigFatLockHeldAdvice
- All Implemented Interfaces:
- org.aopalliance.aop.Advice, AspectJPrecedenceInformation, BeforeAdvice, MethodBeforeAdvice, Ordered
public class BigFatLockHeldAdvice
- extends AspectJMethodBeforeAdvice
AspectJ method "before advice" that verifies that the BigFatLock is held.
| Methods inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice |
argBinding, buildSafePointcut, calculateArgumentBindings, createParameterNameDiscoverer, currentJoinPoint, getAspectClassLoader, getAspectInstanceFactory, getAspectJAdviceMethod, getAspectName, getDeclarationOrder, getDiscoveredReturningGenericType, getDiscoveredReturningType, getDiscoveredThrowingType, getJoinPoint, getJoinPointMatch, getJoinPointMatch, getOrder, getPointcut, invokeAdviceMethod, invokeAdviceMethod, invokeAdviceMethodWithGivenArgs, setArgumentNames, setArgumentNamesFromStringArray, setAspectName, setDeclarationOrder, setReturningName, setReturningNameNoCheck, setThrowingName, setThrowingNameNoCheck, supportsProceedingJoinPoint, toString |
BigFatLockHeldAdvice
public BigFatLockHeldAdvice(Method aspectJBeforeAdviceMethod,
AspectJExpressionPointcut pointcut,
AspectInstanceFactory aif)
- Constructor.
before
public void before(Method method,
Object[] args,
Object target)
- Verifies the
BigFatLock is held. If not, lockNotHeld() is invoked.
- Specified by:
before in interface MethodBeforeAdvice- Overrides:
before in class AspectJMethodBeforeAdvice
lockNotHeld
protected void lockNotHeld()
- Invoked in cases where the current thread does not hold the
BigFatLock.
The implementation in BigFatLockHeldAdvice throws a BigFatLockNotHeldException.
Subclasses can override to suit.