Announcement Announcement Module
Collapse
No announcement yet.
AOP working with external classes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AOP working with external classes

    Hi,

    I want to use AOP for classes not inside spring context.

    <bean id="dbQueryCrackerAspect" class="com.my.db.DBQueryCrackerAspect"/>

    <aop:aspectj-autoproxy proxy-target-class="true">
    <aop:include name="dbQueryCrackerAspect"/>
    </aop:aspectj-autoproxy>

    @Aspect
    public class DBQueryCrackerAspect {
    @Around(value = "execution(public * org.hsqldb.jdbc.JDBCPreparedStatement.*(..))")
    public Object testCalled(final ProceedingJoinPoint pjp) throws Throwable {
    System.out.println("AAAAAAAAAAAAAAAAA!!!!!!!!!!!!! !!!!!!!");

    return pjp.proceed();
    }
    }


    is it possible?

    Thanks in advance!

  • #2
    Please use [ code][/code ] tags when posting code/xml/stacktraces!!!

    Short answer no, for that you would have to use the full blown AspectJ solution with compile time or loadtime weaving.

    Comment

    Working...
    X