I've some questions on Seam Interceptors to understand this better:
1. is it right, that the seam interceptors (cusom one i mean, the chap in the ref is named like that) are usual intercetors and the only seam controlled thing in th creation of th annotation?
2. on which parts can these interceptors be placed? all types of EJBs/seam components? Also Entities?
and on methods, fields, types,...?
Is there a deeper description than in the reference manual?
I tried to annotate fields/getters on an entityBean with:
@Interceptors(TestEntityInterceptor.class)
@TestEntity
@Target({FIELD, METHOD}) @Retention(RUNTIME) @Documented @Interceptors(TestEntityInterceptor.class) public @interface TestEntity {}
@Around({BijectionInterceptor.class, ValidationInterceptor.class, ConversationInterceptor.class, BusinessProcessInterceptor.class, LoggedInInterceptor.class}) @Within({RemoveInterceptor.class}) public class TestEntityInterceptor { public TestEntityInterceptor() {} @AroundInvoke public Object testing(InvocationContext invocation) throws Exception { System.out.println("INTERCEPTOR CALLED AT"+ invocation.getMethod()); return invocation.proceed(); } }
1, Correct.
2, You can have an interceptor upon anything that is not an entity :)