Class CDIBatchArtifactFactoryImpl
- java.lang.Object
-
- com.ibm.jbatch.container.services.impl.CDIBatchArtifactFactoryImpl
-
- All Implemented Interfaces:
IBatchArtifactFactory,IBatchServiceBase
- Direct Known Subclasses:
WeldSEBatchArtifactFactoryImpl
public class CDIBatchArtifactFactoryImpl extends Object implements IBatchArtifactFactory
-
-
Constructor Summary
Constructors Constructor Description CDIBatchArtifactFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected jakarta.enterprise.inject.spi.Bean<?>findUniqueBeanForClass(jakarta.enterprise.inject.spi.BeanManager beanManager, Class<?> clazz)protected jakarta.enterprise.inject.spi.Bean<?>getBeanById(jakarta.enterprise.inject.spi.BeanManager bm, String id)protected ClassLoadergetContextClassLoader()protected jakarta.enterprise.inject.spi.Bean<?>getUniqueBeanByBeanName(jakarta.enterprise.inject.spi.BeanManager bm, String batchId)Use the given BeanManager to lookup a unique CDI-registered bean with bean name equal to 'batchId', using EL matching rules.protected jakarta.enterprise.inject.spi.Bean<?>getUniqueBeanForBatchXMLEntry(jakarta.enterprise.inject.spi.BeanManager bm, String batchId)Use the given BeanManager to lookup a unique CDI-registered bean with bean class equal to the batch.xml entry mapped to be the batchId parameterprotected jakarta.enterprise.inject.spi.Bean<?>getUniqueBeanForClassName(jakarta.enterprise.inject.spi.BeanManager bm, String className)voidinit(IBatchConfig batchConfig)Objectload(String batchId)protected jakarta.enterprise.inject.spi.BeanManagerobtainBeanManager()voidshutdown()
-
-
-
Method Detail
-
load
public Object load(String batchId)
- Specified by:
loadin interfaceIBatchArtifactFactory- Parameters:
batchId- The value of a @ref attribute in a JSL element, e.g. 'batchlet'- Returns:
- An object instance of the artifact.
-
obtainBeanManager
protected jakarta.enterprise.inject.spi.BeanManager obtainBeanManager() throws NamingException- Throws:
NamingException
-
getBeanById
protected jakarta.enterprise.inject.spi.Bean<?> getBeanById(jakarta.enterprise.inject.spi.BeanManager bm, String id)- Parameters:
id- Either the EL name of the bean, its id in batch.xml, or its fully qualified class name.- Returns:
- the bean for the given artifact id.
-
getUniqueBeanByBeanName
protected jakarta.enterprise.inject.spi.Bean<?> getUniqueBeanByBeanName(jakarta.enterprise.inject.spi.BeanManager bm, String batchId)Use the given BeanManager to lookup a unique CDI-registered bean with bean name equal to 'batchId', using EL matching rules.- Returns:
- the bean with the given bean name, or 'null' if there is an ambiguous resolution
-
getUniqueBeanForBatchXMLEntry
protected jakarta.enterprise.inject.spi.Bean<?> getUniqueBeanForBatchXMLEntry(jakarta.enterprise.inject.spi.BeanManager bm, String batchId)Use the given BeanManager to lookup a unique CDI-registered bean with bean class equal to the batch.xml entry mapped to be the batchId parameter- Returns:
- the bean with the given className. It returns null if there are zero matches or if there is no umabiguous resolution (i.e. more than 1 match)
-
getUniqueBeanForClassName
protected jakarta.enterprise.inject.spi.Bean<?> getUniqueBeanForClassName(jakarta.enterprise.inject.spi.BeanManager bm, String className)
-
findUniqueBeanForClass
protected jakarta.enterprise.inject.spi.Bean<?> findUniqueBeanForClass(jakarta.enterprise.inject.spi.BeanManager beanManager, Class<?> clazz) throws jakarta.enterprise.inject.AmbiguousResolutionException- Returns:
- the bean within the given set whose class matches the given clazz.
- Throws:
BatchCDIAmbiguousResolutionCheckedException- if more than one match is foundjakarta.enterprise.inject.AmbiguousResolutionException
-
getContextClassLoader
protected ClassLoader getContextClassLoader()
- Returns:
- thread context classloader
-
init
public void init(IBatchConfig batchConfig) throws BatchContainerServiceException
- Specified by:
initin interfaceIBatchServiceBase- Throws:
BatchContainerServiceException
-
shutdown
public void shutdown() throws BatchContainerServiceException- Specified by:
shutdownin interfaceIBatchServiceBase- Throws:
BatchContainerServiceException
-
-