[jboss-user] [JBoss Seam] - Re: the intercept component don't work!
that's ok,thank you! but how to define a seam component? Is not it to use @Name to define? pardon my prolixity! View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4079425#4079425 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079425 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: the intercept component don't work!
Yes, you use @Name to define a seam component. So, if you called Component.getInstance(interceptsTest), the @Logger field would be filled. But when Seam instantiates an interceptor from the class you specify, it just treats it like a normal object. It doesn't inject @Loggers or give it interceptors for bijection, etc. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4079430#4079430 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079430 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: the intercept component don't work!
i understand thank you very much again! View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4079816#4079816 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079816 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: the intercept component don't work!
my test intercept: @Name(interceptsTest) | @Interceptor | public class InterceptsTest { | @Logger | Log log; | | | @AroundInvoke | public Object doLogs(InvocationContext inv) throws Exception { | | int methodModify = inv.getMethod().getModifiers(); | String methodName = inv.getMethod().getName(); | | if (methodModify == Modifier.PUBLIC | (methodName.startsWith(create) | || methodName.startsWith(update) | || methodName.startsWith(persist) | || methodName.startsWith(remove))) { | | Map data = inv.getContextData(); | Object target = inv.getTarget(); | log.debug(ContextData: + data); | log.debug(Target: + target); | } | | return inv.proceed(); | } | | } my invoke intercept class: @Name(useIntercept) | @Interceptors(InterceptsTest.class) | public class UseIntercept { | | public void persist() { | System.out.println( do persist() ); | } | | } help me,please thank you View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4079000#4079000 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079000 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: the intercept component don't work!
What's the code that calls persist()? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4079001#4079001 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079001 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: the intercept component don't work!
thank your reply! i use a test case to call the persist method,the following is code: @Test | public void testIntercept() throws Exception { | new ComponentTest() { | protected void testComponents() throws Exception { | invokeMethod(#{useIntercept.persist}); | } | }.run(); | } View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4079069#4079069 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079069 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: the intercept component don't work!
I think because your component is a javabean component, you can't use @Interceptors directly on it. Instead, you do something like: | | @Name(useIntercept) | @LogCrudOperations | public class UseIntercept { | | public void persist() { | System.out.println( do persist() ); | } | | } | | @Interceptors(InterceptsTests.class) | @Retention(RetentionPolicy.RUNTIME) | @Target(ElementType.TYPE) | public @interface LogCrudOperations { | } | View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4079226#4079226 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079226 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: the intercept component don't work!
Also, your interceptor (InterceptsTest) doesn't get to be a Seam component. So @Logger won't work. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4079228#4079228 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079228 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: the intercept component don't work!
Use [ code ] tags View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4078651#4078651 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4078651 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user