0 Replies Latest reply: Aug 3, 2010 11:16 AM by Alexey S RSS

how to use JBoss AOP with portlets

Alexey S Newbie

Hello everyone,

 

probably my question is very stiuped but I'm just start studying JBoss AOP....

So, I would like to use Jboss AOP together with Portlet (IPC). I have to use Jetspeed as Apache server (it is not my mind - it is part of my task..)

Well I have created simple application where AOP stuff should be used every time when the doView portlet's metod is called. The ANT compiles my project in Ecllipce without any error ant it can be deployed on Jetspeed. But... I have not got any results from AOP. It looks like AOP's functions do not call at all.

Source code below:

 

     public class AOPTestAspect {
       
         public Object run(MethodInvocation invocation) throws Throwable {
        try
        {
            System.out.println("Hello from Aspect");
            return invocation.invokeNext();
        }
        finally
        {
        }
    }
}

 

public class IPCEAOPPortlet extends javax.portlet.GenericPortlet
{
   
    public void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
    throws javax.portlet.PortletException, java.io.IOException
    {
        response.setContentType("text/html");
        response.getWriter().println("Hello world!");
    }
}

 

jboss-aop looks like

<aop>
   <aspect/>class="AOPTestAspect<aspect>

 

   <bind pointcut="execution(void IPCEAOPPortlet->doView(..))">
      <around aspect="aoptest.AOPTestAspect" name="run"></around>
   </bind>
</aop>

 

Could anybody to explane me where I maek a misprints?

Probably there is a clear explanation in docs or are there examples of AOP's using with portlets?

 

Thanks a lot,

Alexey