Results 1 to 2 of 2

Thread: AOP working with external classes

  1. #1

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Tags for this Thread

Posting Permissions

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