[jboss-user] [Beginners Corner] - Can I use aspectj in jboss ?

umen do-not-reply at jboss.com
Thu Nov 22 03:34:23 EST 2007


Hello all I like to use aspectJ with my application, now I put the aspectjrt.jar into my server -> all -> lib directory
And the application is loaded with no exception but when I execute the class 's I don’t get any aspectJ prints ( I used system.out.println with the
@Around annotation) .
Wheni test this with simple class outside the jobss it working great
Do I need to know something else when using aspectJ with jboss ?

this is the code :

    code:
  | 
  |     @Pointcut("call(* com.aop..*(..) )")
  |     	void callBeforeAndAfterMethod(){}
  |     	
  |     	@Around( "callBeforeAndAfterMethod()" )
  |     	public Object aroundTrace( ProceedingJoinPoint jp ) throws Throwable {
  |     		String methodName = jp.getSignature().getName();
  |     		System.out.println("Method name : " + methodName);
  |     		System.out.println("Before code processed....");
  |     		Object ret = jp.proceed();
  |     		System.out.println("After code processed....");
  |     		return ret;
  |     	}

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106986#4106986

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106986




More information about the jboss-user mailing list