Package org.datanucleus
Class CDIHandler
- java.lang.Object
-
- org.datanucleus.CDIHandler
-
public class CDIHandler extends java.lang.Object
Handles the integration of "javax.enterprise.inject" CDI API. Note that this is the only class referring to CDI classes so that it is usable in environments without CDI present. TODO Make this thread-safe
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.enterprise.inject.spi.BeanManager
beanManager
(package private) java.util.Set<javax.enterprise.context.spi.CreationalContext>
creationalContexts
(package private) java.util.Map<java.lang.Object,javax.enterprise.inject.spi.InjectionTarget>
injectionTargets
Cache of InjectionTarget keyed by the object that they created.
-
Constructor Summary
Constructors Constructor Description CDIHandler(java.lang.Object beanMgr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
<T> T
createObjectWithInjectedDependencies(java.lang.Class<T> cls)
Method to instantiate an object of the specified type with injected dependencies.
-
-
-
Field Detail
-
beanManager
javax.enterprise.inject.spi.BeanManager beanManager
-
creationalContexts
java.util.Set<javax.enterprise.context.spi.CreationalContext> creationalContexts
-
injectionTargets
java.util.Map<java.lang.Object,javax.enterprise.inject.spi.InjectionTarget> injectionTargets
Cache of InjectionTarget keyed by the object that they created.
-
-
Method Detail
-
createObjectWithInjectedDependencies
public <T> T createObjectWithInjectedDependencies(java.lang.Class<T> cls)
Method to instantiate an object of the specified type with injected dependencies.- Type Parameters:
T
- Type of the object- Parameters:
cls
- The type to instantiate- Returns:
- The instance
-
close
public void close()
-
-