[jboss-user] [JBoss Seam] - Re: Intercepting Seam components/Support for AspectJ

jacob.orshalick do-not-reply at jboss.com
Tue Nov 20 20:05:21 EST 2007


"b.reeve" wrote : 1. Is there a way to intercept just the methods and not the class.
Seam does not support method level interceptors, but you can always place the interceptor at the class level and use a method-level annotation to define the method(s) that should be intercepted.  I provide an example of this on my blog (in the second half of the posting):

http://solutionsfit.com/blog/2007/11/09/thoughts-on-webbeans-and-stereotypes/

If this is not appealing you could use regexes on the InvocationContext to achieve the same results (i.e. if method being invoked matches pattern, run interceptor code).

"b.reeve" wrote : 2. Is there any way to collectively configure a set of classes or pattern in the interceptor as we do with Spring. (So that we dont have to modify the seam component at all) 

You can do this type of thing through an EJB interceptor and configure it in your ejb-jar.xml, but to my knowledge pattern matching is not directly supported by Seam interceptors.  The direction of Web Beans (http://jcp.org/en/jsr/detail?id=299 submitted based on Seam) covers this case through the use of stereotypes.  In the blog-posting above I describe how to achieve stereotypes with Seam which is an option for collective configuration.  Hope that helps.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106582#4106582

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106582



More information about the jboss-user mailing list