public class CdiObjectFactory extends ObjectFactory
struts.objectFactory.cdi.jndiKey
is given, this key will be looked upCDI_JNDIKEY_BEANMANAGER_COMP
CDI_JNDIKEY_BEANMANAGER_APP
CDI_JNDIKEY_BEANMANAGER_COMP_ENV
Modifier and Type | Field and Description |
---|---|
protected javax.enterprise.inject.spi.BeanManager |
beanManager |
static String |
CDI_JNDIKEY_BEANMANAGER_APP
The key under which the BeanManager can be found according to JBoss Weld docs
|
static String |
CDI_JNDIKEY_BEANMANAGER_COMP
The key under which the BeanManager can be found according to CDI API docs
|
static String |
CDI_JNDIKEY_BEANMANAGER_COMP_ENV
The key under which the BeanManager can be found in pure Servlet containers according to JBoss Weld docs.
|
Constructor and Description |
---|
CdiObjectFactory() |
Modifier and Type | Method and Description |
---|---|
Object |
buildBean(String className,
Map<String,Object> extraContext,
boolean injectInternal) |
protected javax.enterprise.context.spi.CreationalContext |
buildNonContextualCreationalContext(javax.enterprise.inject.spi.BeanManager beanManager)
Simple wrapper for CreationalContext creation.
|
protected javax.enterprise.inject.spi.BeanManager |
findBeanManager()
Try to find the CDI BeanManager from JNDI context.
|
protected javax.enterprise.inject.spi.InjectionTarget<?> |
getInjectionTarget(Class<?> clazz)
Get a InjectionTarget instance for a given class.
|
boolean |
isNoArgConstructorRequired()
Allow constructor injection
|
protected javax.enterprise.inject.spi.BeanManager |
lookup(Context context,
String jndiKeyToCheck)
Lookup the given JNDI key in the given context.
|
void |
setJndiKey(String jndiKey) |
buildAction, buildBean, buildBean, buildConverter, buildInterceptor, buildResult, buildUnknownHandler, buildValidator, getClassInstance, injectInternalBeans, setActionFactory, setClassLoader, setContainer, setConverterFactory, setInterceptorFactory, setResultFactory, setUnknownHandlerFactory, setValidatorFactory
public static final String CDI_JNDIKEY_BEANMANAGER_COMP
public static final String CDI_JNDIKEY_BEANMANAGER_APP
public static final String CDI_JNDIKEY_BEANMANAGER_COMP_ENV
protected javax.enterprise.inject.spi.BeanManager beanManager
public void setJndiKey(String jndiKey)
protected javax.enterprise.inject.spi.BeanManager findBeanManager()
CDI_JNDIKEY_BEANMANAGER_COMP
will be tested. If nothing is found there, the key CDI_JNDIKEY_BEANMANAGER_APP
will be checked. If still nothing is found there, the key CDI_JNDIKEY_BEANMANAGER_COMP_ENV
will be checked.protected javax.enterprise.inject.spi.BeanManager lookup(Context context, String jndiKeyToCheck)
context
- the context to use for lookup.jndiKeyToCheck
- the key to lookup.NamingException
was thrown.public Object buildBean(String className, Map<String,Object> extraContext, boolean injectInternal) throws Exception
buildBean
in class ObjectFactory
Exception
protected javax.enterprise.inject.spi.InjectionTarget<?> getInjectionTarget(Class<?> clazz)
clazz
- The class to get a InjectionTarget instance for.protected javax.enterprise.context.spi.CreationalContext buildNonContextualCreationalContext(javax.enterprise.inject.spi.BeanManager beanManager)
beanManager
- the BeanManager to use for creating the context.public boolean isNoArgConstructorRequired()
isNoArgConstructorRequired
in class ObjectFactory
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.