0 Replies Latest reply on Apr 5, 2011 3:14 AM by narayan812

    How to work with aspects?

    narayan812

      Hi.

       

      I am a little noob in Jboss AOP. I read a lot of manual and undestood that aspects in Jboss can be defined

      with xml or annotations. I prefer to use annotations. So, almost each articles told how to write aspect but

      I didn't find how to configure jboss to work wit it. I undestood that I can create for instance class like this:

       

      @Aspect( scope = Scope.PER_VM )
      public class LogControlAspect
      {
          public static final Logger log = Logger.getLogger( "defgoLogger" );
      
          @Bind( pointcut = "execution(net.defgo.logger.impl.DiaryLoggerBean+ * *(..))" )
          public Object trace( Invocation invocation ) throws Throwable
          {
              log.debug( "!!!! ENTER !!!!" );
              Object method = invocation.invokeNext();
              log.debug( "!!!! EXIT !!!!:" + method );
              return method;
          }
      }
      

       

      but what should I do to force it work? I think it should be some lines in jboss configs but I can't find what exactly.

      Coult you please tell how to work with aspects?