Class ProgrammaticBeanLookup
- java.lang.Object
-
- org.camunda.bpm.engine.cdi.impl.util.ProgrammaticBeanLookup
-
public class ProgrammaticBeanLookup extends java.lang.Object
Utility class for performing programmatic bean lookups.- Author:
- Daniel Meyer, Mark Struberg
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.logging.Logger
LOG
-
Constructor Summary
Constructors Constructor Description ProgrammaticBeanLookup()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
lookup(java.lang.Class<T> clazz)
static <T> T
lookup(java.lang.Class<T> clazz, boolean optional)
static <T> T
lookup(java.lang.Class<T> clazz, javax.enterprise.inject.spi.BeanManager bm)
static <T> T
lookup(java.lang.Class<T> clazz, javax.enterprise.inject.spi.BeanManager bm, boolean optional)
static java.lang.Object
lookup(java.lang.String name)
static java.lang.Object
lookup(java.lang.String name, javax.enterprise.inject.spi.BeanManager bm)
static java.lang.Object
lookup(java.lang.String name, javax.enterprise.inject.spi.BeanManager bm, boolean optional)
-
-
-
Method Detail
-
lookup
public static <T> T lookup(java.lang.Class<T> clazz, javax.enterprise.inject.spi.BeanManager bm)
-
lookup
public static <T> T lookup(java.lang.Class<T> clazz, javax.enterprise.inject.spi.BeanManager bm, boolean optional)
-
lookup
public static java.lang.Object lookup(java.lang.String name, javax.enterprise.inject.spi.BeanManager bm)
-
lookup
public static java.lang.Object lookup(java.lang.String name, javax.enterprise.inject.spi.BeanManager bm, boolean optional)
-
lookup
public static <T> T lookup(java.lang.Class<T> clazz)
- Returns:
- a ContextualInstance of the given type
- Throws:
javax.enterprise.inject.AmbiguousResolutionException
- if the given type is satisfied by more than one Bean- See Also:
lookup(Class, boolean)
-
lookup
public static <T> T lookup(java.lang.Class<T> clazz, boolean optional)
- Parameters:
optional
- iffalse
then the bean must exist.- Returns:
- a ContextualInstance of the given type if optional is
false
. If optional istrue
null might be returned if no bean got found. - Throws:
java.lang.IllegalStateException
- if there is no bean of the given class, but only if optional isfalse
javax.enterprise.inject.AmbiguousResolutionException
- if the given type is satisfied by more than one Bean- See Also:
lookup(Class, boolean)
-
lookup
public static java.lang.Object lookup(java.lang.String name)
-
-