Hi,
i was able to write a seam interceptor (class-level) for a SLSB. Due to the nature of class-level interceptors, each method invocation of this SLSB will notify
the interceptor.
As i am interested only in one specific method-invocation, i changed the Target's seam interface from TYPE to METHOD and annotated the method i am interested in. Unfortunately, the interceptor is never invoked/informed.
Are method seam interceptors not supported or do is my interface wrong ?
Here is the code:
@Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Interceptors({ManufacturerActivationInterceptor.class}) public @interface ManufacturerActivation { }
Greetings
You must use a class-level interceptor and then you can determine by reflection whether to intercept the method invocation. This blog posting provides a tutorial on how to do this with Seam. Hope it helps.