org.camunda.bpm.engine.cdi.impl.util
Class ProgrammaticBeanLookup

java.lang.Object
  extended by org.camunda.bpm.engine.cdi.impl.util.ProgrammaticBeanLookup

public class ProgrammaticBeanLookup
extends Object

Utility class for performing programmatic bean lookups.

Author:
Daniel Meyer, Mark Struberg

Field Summary
static Logger LOG
           
 
Constructor Summary
ProgrammaticBeanLookup()
           
 
Method Summary
static
<T> T
lookup(Class<T> clazz)
           
static
<T> T
lookup(Class<T> clazz, javax.enterprise.inject.spi.BeanManager bm)
           
static
<T> T
lookup(Class<T> clazz, javax.enterprise.inject.spi.BeanManager bm, boolean optional)
           
static
<T> T
lookup(Class<T> clazz, boolean optional)
           
static Object lookup(String name)
           
static Object lookup(String name, javax.enterprise.inject.spi.BeanManager bm)
           
static Object lookup(String name, javax.enterprise.inject.spi.BeanManager bm, boolean optional)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final Logger LOG
Constructor Detail

ProgrammaticBeanLookup

public ProgrammaticBeanLookup()
Method Detail

lookup

public static <T> T lookup(Class<T> clazz,
                           javax.enterprise.inject.spi.BeanManager bm)

lookup

public static <T> T lookup(Class<T> clazz,
                           javax.enterprise.inject.spi.BeanManager bm,
                           boolean optional)

lookup

public static Object lookup(String name,
                            javax.enterprise.inject.spi.BeanManager bm)

lookup

public static Object lookup(String name,
                            javax.enterprise.inject.spi.BeanManager bm,
                            boolean optional)

lookup

public static <T> T lookup(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(Class<T> clazz,
                           boolean optional)
Parameters:
optional - if false then the bean must exist.
Returns:
a ContextualInstance of the given type if optional is false. If optional is true null 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(Class, boolean)

lookup

public static Object lookup(String name)


Copyright © 2016 camunda services GmbH. All rights reserved.