[jboss-user] [JBoss Seam] - Re: Seam Interceptors
Kragoth
do-not-reply at jboss.com
Wed Jan 9 19:33:59 EST 2008
Ok, I've made a bit of progress, and I have a working interceptor.
Code as follows:
The actual interceptor:
| package gekko.web.services;
|
| import org.jboss.seam.annotations.intercept.AroundInvoke;
| import org.jboss.seam.annotations.intercept.Interceptor;
| import org.jboss.seam.intercept.AbstractInterceptor;
| import org.jboss.seam.intercept.InvocationContext;
| import org.jboss.seam.log.LogProvider;
| import org.jboss.seam.log.Logging;
|
| @Interceptor
| public class GekkoSpringInjector extends AbstractInterceptor {
|
| private static final LogProvider log = Logging
| .getLogProvider(GekkoSpringInjector.class);
|
| @AroundInvoke
| public Object aroundInvoke(InvocationContext invocation) throws Exception {
| log.debug("********************************************");
| Object result = invocation.proceed();
| return result;
| }
|
| }
|
The annotation
| package gekko.web.services;
|
| import static java.lang.annotation.ElementType.TYPE;
| import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
| import java.lang.annotation.Retention;
| import java.lang.annotation.Target;
|
| import org.jboss.seam.annotations.intercept.Interceptors;
|
| @Target(TYPE)
| @Retention(RUNTIME)
| @Interceptors(GekkoSpringInjector.class)
| public @interface SeamAutowired {}
|
My only concern now is that every Seam bean will now have to have this annotation for the interceptor to fire. How can I make this a "default" interceptor? Just like the Bijection Interceptor. Cause as it stands I don't see any way of doing this as the Bijection Interceptor is hard coded as a default interceptor
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118478#4118478
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118478
More information about the jboss-user
mailing list