Announcement Announcement Module
Collapse
No announcement yet.
Context Based configuration works different Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Context Based configuration works different

    I'm trying to implement the following rules with Spring Schema Based AOP

    I want handleExceptionThrownByAnnotatedMethod to be called on methods annotated with HandleThrown.

    In case Class is annotated with HandleThrown it's methods call must be handled by handleExceptionThrownByMethodAnnotatedClass (in case they are not annotated with HandleThrown).

    here is my spring context file part

    <bean id="handleExceptionAspect" class="org.excha.aspect.HandleThrownAspect" />

    <aop:config>
    <aop:aspect ref="handleExceptionAspect">
    <aop:around pointcut="@annotation(s)" method="handleExceptionThrownByAnnotatedMethod" arg-names="s" />
    <aop:around pointcut="execution( !@org.excha.HandleThrown *(@org.excha.HandleThrown *).*(..) ) &amp;&amp; @target(s)" method="handleExceptionThrownByMethodAnnotatedClas s" arg-names="s" />
    </aop:aspect>
    </aop:config>

    both methods handleExceptionThrownByMethodAnnotatedClass and
    handleExceptionThrownByAnnotatedMethod
    are called in case class and method are annotated with HandleThrown

    I can not understand why


    The most strange thing is that apsect configuration based on ApectJ annotations works fine.



    @Around("@annotation(s)")
    public Object handleExceptionThrownByAnnotatedMethod(ProceedingJ oinPoint pjp, HandleThrown s) throws Throwable {
    return ExceptionHandlingUtils.handleThrown(pjp, s);
    }

    @Around("execution(!@org.excha.HandleThrown *(@org.excha.HandleThrown *).*(..)) && @target(s)")
    public Object handleExceptionThrownByMethodAnnotatedClass(Procee dingJoinPoint pjp, HandleThrown s) throws Throwable {
    return ExceptionHandlingUtils.handleThrown(pjp, s);
    }

    What's wrong with my context based configuration?

    Dating Friends
    New Look Voucher Codes
    Last edited by Plastics; Apr 7th, 2011, 01:07 PM.

  • #2
    The problem was in my IDE - everything works fine.


    Sorry for interrupting, keep doing the right job guys.

    Comment

    Working...
    X