7 Replies Latest reply on Nov 24, 2007 1:58 PM by pmuir

    Seam + JBoss AOP

    asookazian

      Are there any situations where it would be advantageous to use JBoss AOP with Seam apps (if possible?)

      I did not see AOP referenced in the Seam books I have. Perhaps this is a stupid question? Counter-question may be "why do you need AOP with Seam?" And it seems that would introduce additional Spring-like xml which would defeat one of the goals of keeping xml content as static as possible.

      any comments?

        • 1. Re: Seam + JBoss AOP

          Yes, you can use JBoss AOP to intercept Seam components. I'd recommend you use Seam POJO in this scenario as EJB3 beans are invoked via proxy and hence cannot be reliably intercepted via standard AOP definitions.

          • 2. Re: Seam + JBoss AOP
            damatrix

            EJB interceptors cannot be used on Seam POJOS. Is it a good idea to use JBoss AOP to create interceptors for a Seam POJOs?

            • 3. Re: Seam + JBoss AOP
              soza

              We found it was usefull to use jBossAOP to address orthogonal behavior lke performance metrics. And you are not restricted to jboss-aop.xml, you could use annotations too. However we did prefer using the XML file as it provides more flexibility.

              • 4. Re: Seam + JBoss AOP
                asookazian

                 

                "damatrix" wrote:
                EJB interceptors cannot be used on Seam POJOS. Is it a good idea to use JBoss AOP to create interceptors for a Seam POJOs?


                this is not true. I am using EJB3 interceptors on Seam SFSB's (conversation-scoped and session-scoped) and SLSB. I am seeing the output in the log for my LoggingInterceptor:

                2007-11-15 16:11:54,704 INFO [com.cox.beans.interceptor.LoggerInterceptor] *** Entering method: getNoteText


                In my case, the interceptors are configured in the ejb-jar.xml (not class or method level).

                • 5. Re: Seam + JBoss AOP
                  asookazian

                   

                  "damatrix" wrote:
                  EJB interceptors cannot be used on Seam POJOS. Is it a good idea to use JBoss AOP to create interceptors for a Seam POJOs?


                  Oh you mean classes that don't have @Stateless or @Stateful annotations (non-EJB3 pojo's) but do have @Name annotation?

                  I don't think I've tried that yet...

                  • 6. Re: Seam + JBoss AOP
                    damatrix

                    I didn't mean EJBs when i said Seam POJOs. I meant java classes without Stateful or Stateless anotations.

                    • 7. Re: Seam + JBoss AOP
                      pmuir

                      You can use Seam interceptors on these.