Class ProgrammaticBeanLookup
java.lang.Object
org.camunda.bpm.engine.cdi.impl.util.ProgrammaticBeanLookup
Utility class for performing programmatic bean lookups.
- Author:
- Daniel Meyer, Mark Struberg
-
Field Details
-
LOG
-
-
Constructor Details
-
ProgrammaticBeanLookup
public ProgrammaticBeanLookup()
-
-
Method Details
-
lookup
-
lookup
public static <T> T lookup(Class<T> clazz, jakarta.enterprise.inject.spi.BeanManager bm, boolean optional) -
lookup
-
lookup
-
lookup
- Returns:
- a ContextualInstance of the given type
- Throws:
jakarta.enterprise.inject.AmbiguousResolutionException
- if the given type is satisfied by more than one Bean- See Also:
-
lookup
- 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:
IllegalStateException
- if there is no bean of the given class, but only if optional isfalse
jakarta.enterprise.inject.AmbiguousResolutionException
- if the given type is satisfied by more than one Bean- See Also:
-
lookup
-