org.ocpsoft.rewrite.cdi.manager
Class BeanManagerAware
java.lang.Object
org.ocpsoft.rewrite.cdi.manager.BeanManagerAware
- Direct Known Subclasses:
- CdiServiceEnricher, CdiServiceLocator
public abstract class BeanManagerAware
- extends Object
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanManagerAware
public BeanManagerAware()
getBeanManager
public javax.enterprise.inject.spi.BeanManager getBeanManager()
isBeanManagerAvailable
public boolean isBeanManagerAvailable()
isBeanManagerInjected
public boolean isBeanManagerInjected()
getBeanManagerLocator
public BeanManagerLocator getBeanManagerLocator()
Copyright © 2012 OCPsoft. All Rights Reserved.