Community

Obtaining the Container in an Interceptor

created by Andrew Rubinger in EJB 3.0 Development - View the full discussion

Currently we've no way of injecting the EJB Container into an Interceptor instance.

 

Instead, how do we feel about setting Invocation metadata to add the container under some known key in before SessionSpecContainer.invoke() calls invocation.invokeNext?  Then interceptors could grab the container via the metadata.

 

The other way we do this now is:

 

((ManagedObjectAdvisor) invocation.getAdvisor()).getContainer()

 

...which is good for unit tests, but in a real environment it's:

 

((ManagedObjectAdvisor) invocation.getAdvisor()).getContainer().getEJBContainer();

 

S,

ALR

Reply to this message by going to Community

Start a new discussion in EJB 3.0 Development at Community