users@glassfish.java.net

Interceptors and classpaths

From: Laird Nelson <ljnelson_at_gmail.com>
Date: Tue, 5 Apr 2011 11:09:16 -0400

Before I haul off and go waste some time trying to put this together, I
thought I'd ask:

Suppose I have two EJB jars in an ear, A and B.

Suppose I have an interceptor class, com.foo.Interceptor, in B that I would
like to install as an interceptor for an EJB in A. That is, A knows nothing
about B or any of its classes, but a B class would like to act as an
interceptor for an EJB in A.

If I modify A's ejb-jar.xml (we're talking EJB 3.1 here) so that it lists
com.foo.Interceptor as an interceptor class, will that class be found?

Finally, since an Interceptor may also be the target of dependency
injection, but is tied to the ENC of the bean for which it is an
interceptor, can my interceptor-from-B have an instance of A's EJB injected
into it?

Thanks,
Laird