Package org.ocpsoft.rewrite.cdi.manager
Class BeanManagerAware
java.lang.Object
org.ocpsoft.rewrite.cdi.manager.BeanManagerAware
- Direct Known Subclasses:
CdiServiceEnricher,CdiServiceLocator
A convenient base class for obtaining a reference to the BeanManager from a non-managed class, or a class which may
not be managed in certain environments (i.e., a listener in a Servlet container).
This class will first check whether the BeanManager was injected. If the injection point was not satisfied,
then this class will use the BeanManagerLocator to lookup the BeanManager in an external context (e.g.,
JNDI).
It's generally acceptable to use this class in cases where injection is not guaranteed. However, in general you should ensure that the classes needing CDI services, such as injection, be available as managed classes.
- Author:
- Dan Allen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.enterprise.inject.spi.BeanManagerbooleanboolean
-
Constructor Details
-
BeanManagerAware
public BeanManagerAware()
-
-
Method Details
-
getBeanManager
public jakarta.enterprise.inject.spi.BeanManager getBeanManager() -
isBeanManagerAvailable
public boolean isBeanManagerAvailable() -
isBeanManagerInjected
public boolean isBeanManagerInjected() -
getBeanManagerLocator
-