Currently, the only portable way to find out whether a request context is active is to call BeanManager#getContext(Class<? extends Annotation>) but this method throws ContextNotActiveException. Note that there is org.jboss.weld.manager.BeanManagerImpl.isContextActive(Class<? extends Annotation>) but it's not part of the API. |