[jboss-user] [JBoss AOP] - Is there any article about using jboss AOP with EJB 2.X

Doochul KIM do-not-reply at jboss.com
Thu Apr 1 09:19:06 EDT 2010


Doochul KIM [http://community.jboss.org/people/headiron] created the discussion

"Is there any article about using jboss AOP with EJB 2.X"

To view the discussion, visit: http://community.jboss.org/message/535188#535188

--------------------------------------------------------------
Hi.

These days I try to use jBoss AOP with EJB 2.X.

I make Aspect class and included on jar that will be include on ear.

And I add a xml file to set a rule.

( Create a new file, named 'jbosstest-aop.xml', and saved on jboss/server/default/deploy dolder. )

When server is started , message about depolying above xml file is displayed

But I try to using it , it isn't work.

Is there any article ( or document ) about using jboss AOP with EJB 2.X session bean?

I use jboss4.0.2 server and , test it with jbossAOP 1.3.1


- Content of 'jbosstest-aop.xml' -

<?xml version='1.0' encoding='UTF-8' ?>
<aop>
    <aspect class="com.xxxx.report.util.ReportLimitHandler"/>
    <bind pointcut="execution(public java.lang.String com.xxxx.business.report.engine.ReportManagerBean->generateReport(com.xxxx.report.vo.ReportParameterVO, com.xxxx.parameters.DBParameters,  com.xxxx.parameters.LogParameters))">
        <around aspect="com.xxxx.report.util.ReportLimitHandler" name="tract"/>        
    </bind>
</aop>

#com.xxxx.business.report.engine.ReportManagerBean is class implement SessionBean

-- Content of 'com.xxxx.report.util.ReportLimitHandler' --
package com.xxxx.report.util;

import org.jboss.aop.joinpoint.Invocation;

public class ReportLimitHandler {

    public Object tract(Invocation invocation) throws Throwable {
        try{
            System.out.println("Entering anything");
            return invocation.invokeNext();
        }
        finally{
            System.out.println("Leaving anything");
        }
    }
}

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/535188#535188]

Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2027]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100401/cb0625e9/attachment.html 


More information about the jboss-user mailing list