[jboss-user] [EJB 3.0 Development] - Obtaining the Container in an Interceptor

Carlo de Wolf do-not-reply at jboss.com
Fri Jun 4 03:23:45 EDT 2010


Carlo de Wolf [http://community.jboss.org/people/wolfc] replied to the discussion

"Obtaining the Container in an Interceptor"

To view the discussion, visit: http://community.jboss.org/message/546160#546160

--------------------------------------------------------------
What exactly do you need from the container?

The code you quote must never be used from an interceptor it's either:
AbstractContainer.getContainer(invocation.getAdvisor());

or
EJBContainer.getContainer(invocation.getAdvisor());

depending on which container you want to talk (the low-level one or the real one).

Alternatively and I think the better approach, because we should be moving away from AOP and onto the real interceptor API.
InvocationContext context = CurrentInvocationContext.get();
AsyncBeanManager manager = (AsyncBeanManager) context.getBeanManager();

(needs work because of the cast.)
boolean doAsync = manager.isAsync(context.getMethod());


--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/546160#546160]

Start a new discussion in EJB 3.0 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100604/546bbbc6/attachment-0001.html 


More information about the jboss-user mailing list