Results 1 to 3 of 3

Thread: Confused about the pointcut expression.

  1. #1

    Default Confused about the pointcut expression.

    Hi,

    I am a bit confused about the pointcut expression.

    I have the following aop.xml

    Code:
    	<weaver>                   
    	    <include within="org.gng.jbc.model.*"/>
    	    <include within="org.crank.crud.*"/>
    	    <include within="org.gng.jbc.dao.*"/>
    	</weaver>
    
    	<aspects>
    	    <aspect name="org.gng.jbc.advice.EncodePassword"/> 
    	    <aspect name="org.gng.jbc.advice.SetOwner"/> 
    	    <concrete-aspect name="org.gng.jbc.advice.ApplicationTraceAspect" 
    	    				 extends="org.gng.jbc.advice.AbstractTraceAspect">
    	    	<pointcut name="traced"
    	    		      expression="call(public * org.crank.crud.GenericDao.*(..))"/>
    	    </concrete-aspect>	   
    	</aspects>
    </aspectj>
    where org.crank.crud.GenericDao is an Interface. Using this form, I failed to capture any thing.

    but if I replace org.crank.crud.GenericDao with org.crank.crud.GenericDaoJpa
    which is the actual class, I can see the capturing.

  2. #2
    Join Date
    Sep 2007
    Location
    Oceanside, CA
    Posts
    187

    Default

    How are you actually calling your DAO in your application? Through an object of the interface type GenericDao, or through an object of the concrete type GenericDaoJpa? call() pointcut type matching works a bit differently than execution(), as described here:

    http://www.eclipse.org/aspectj/doc/r...s.html#d0e5716

    Also, have you tried adding the subtype matching operator to your expression? For example:

    Code:
    call(public * org.crank.crud.GenericDao+.*(..))
    Mike Bingham

  3. #3

    Default

    thanks for the help.

    through an object which is created by the ProxyFactoryBean having the GenericDao interface. The actual bean carrying out the operation is created by the ProxyFactoryBean which is instance of GenericDaoJpa.

    I have tried GenericDao+.* or GenericDao*.* and both doesn't work. In fact I would say it not work all the time but that the capture is very different.

    I need to be very specific

    "execution(public * org.crank.crud.GenericDaoJpa.*(..))" to get the expected behaviour.

    Another very strange thing is that a @before advice and a @around advice would show different result, even using the same pointcut expression.

    That is why I said I am confused.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •