2 Replies Latest reply on Apr 7, 2005 4:08 PM by drakonis

    New to jboss aop

    drakonis

      Hi guys. I'm kinda freakin out, i can't succed at all with this AOP stuff.
      Got the

      package com.balamaci;
      public class FunctionarBean implements SessionBean {
      ..
      ..
      public void SNAPSHOT()
       {
       System.err.println("Say hello");
       }
      }
      

      also this
      package com.balamaci;
      import ...
      public class SimpleInterceptor implements Interceptor{
       public String getName() {
       System.err.println("SimpleInterceptor");
       System.out.println("<<< Entering SimpleInterceptor");
       return "SimpleInterceptor";
       }
      
       public Object invoke(Invocation invocation) throws Throwable
       {
       try
       {
       System.err.println("<<< Entering SimpleInterceptor");
       System.out.println("<<< Entering SimpleInterceptor");
       return invocation.invokeNext();
       }
       finally
       {
       System.err.println(">>> Leaving SimpleInterceptor");
       }
       }
      }
      

      Created in the META-INF a jboss-aop.xml looks like this






      Yeah, well it took me two hours to understand i was missing a ), but nevermind..

      So i bundle up this fellas up and nice in a jar. Off with them in the /default/deploy/Test directory. I lookup the bean and call SNAPSHOT, get the Hello message but nothing else. I delete the jboss-aop.xml from the META-INF, and recreate the jar. I create it in the /default/deploy/Test/META-INF and put there the jboss-aop.xml. Still nothing else. I begin to change to execution(* com.balamaci.FunctionarBean->SNAPSHOT(..))"
      ,even to execution(* com.balamaci.FunctionarBean->setSessionContext(..))" still to no avail. Please, am I doing something wrong here? It can't find the com.balamaci.SimpleInterceptor class? It doesn't complain when i mistype it.

      It's been like 5 hours now and it's getting really depresing.

        • 1. Re: New to jboss aop
          drakonis

          I just realised that the xml is not showing. And i must be really tired cause i can;t see the edit button anywhere. Where the hell is it??

          Well the jboss-aop.xml looks like this:

          <aop>
          <bind pointcut="execution(public void com.balamaci.FunctionarBean->SNAPSHOT(..))">
           <interceptor class="com.balamaci.SimpleInterceptor"/>
          </bind>
          </aop>
          



          • 2. Re: New to jboss aop
            drakonis

            I had to set in /default/deploy/jboss-aop.deployer/META-INF/jboss-service.xml EnableTransformer to true.