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- 
ProgrammaticBeanLookuppublic ProgrammaticBeanLookup()
 
- 
- 
Method Details- 
lookup
- 
lookuppublic static <T> T lookup(Class<T> clazz, javax.enterprise.inject.spi.BeanManager bm, boolean optional) 
- 
lookup
- 
lookup
- 
lookup- 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- Parameters:
- optional- if- falsethen the bean must exist.
- Returns:
- a ContextualInstance of the given type if optional is false. If optional istruenull might be returned if no bean got found.
- Throws:
- IllegalStateException- if there is no bean of the given class, but only if optional is- false
- javax.enterprise.inject.AmbiguousResolutionException- if the given type is satisfied by more than one Bean
- See Also:
 
- 
lookup
 
-