This content has been marked as final.
Show 3 replies
-
1. Re: Seam Interceptors
pmuir Jan 9, 2008 7:32 PM (in response to kragoth)There is no way currently in Seam to add to the default interceptor stack I'm afraid (there is an open JIRA issue for this).
You can use a Seam interceptor to make it into an annotation - see the ref manual -
2. Re: Seam Interceptors
kragoth Jan 9, 2008 7:33 PM (in response to kragoth)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 annotationpackage 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 -
3. Re: Seam Interceptors
kragoth Jan 9, 2008 7:34 PM (in response to kragoth)oops sorry posted at the same time.
Thanks for your answer. Hope to see default interceptors soon :)