org.dellroad.stuff.servlet
Class BigFatLockHeldAdvice

java.lang.Object
  extended by org.springframework.aop.aspectj.AbstractAspectJAdvice
      extended by org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
          extended by 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.


Field Summary
 
Fields inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
aspectJAdviceMethod, JOIN_POINT_KEY
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
BigFatLockHeldAdvice(Method aspectJBeforeAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif)
          Constructor.
 
Method Summary
 void before(Method method, Object[] args, Object target)
          Verifies the BigFatLock is held.
protected  void lockNotHeld()
          Invoked in cases where the current thread does not hold the BigFatLock.
 
Methods inherited from class org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
isAfterAdvice, isBeforeAdvice
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BigFatLockHeldAdvice

public BigFatLockHeldAdvice(Method aspectJBeforeAdviceMethod,
                            AspectJExpressionPointcut pointcut,
                            AspectInstanceFactory aif)
Constructor.

Method Detail

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.