public class HaCdiCommons extends Object
| Constructor and Description |
|---|
HaCdiCommons() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addBeanRegistryToContext(ClassPool classPool,
CtClass ctClass)
Adds the bean registry to context.
|
static List<Object> |
getBeanInstances(javax.enterprise.inject.spi.Bean<?> bean)
Return all bean instances.
|
static Class<? extends javax.enterprise.context.spi.Context> |
getContextClass(Class<? extends Annotation> scope)
Gets the context class for specified scope.
|
static boolean |
isInExtraScope(javax.enterprise.inject.spi.Bean<?> bean) |
static boolean |
isRegisteredScope(Class<? extends Annotation> scope)
Checks if scope is registered
|
static void |
registerContextClass(Class<? extends Annotation> scope,
Class<? extends javax.enterprise.context.spi.Context> contextClass)
Register context class.
|
static void |
registerExtraContext(HaCdiExtraContext extraContext)
Register extra context.
|
static void |
transformContext(ClassPool classPool,
CtClass ctClass)
Add bean registry field to context, register bean instances in get(...) methods
|
static void |
transformGet1(ClassPool classPool,
CtClass ctClass)
Transform 1 argument get method :
public |
static void |
transformGet2(ClassPool classPool,
CtClass ctClass)
Transform 2 arguments get method :
public |
static void |
unregisterExtraContext(HaCdiExtraContext extraContext)
Unregister extra context.
|
public static boolean isInExtraScope(javax.enterprise.inject.spi.Bean<?> bean)
public static void transformContext(ClassPool classPool, CtClass ctClass) throws CannotCompileException, NotFoundException
classPool - the class poolctClass - the ct classCannotCompileException - the cannot compile exceptionNotFoundException - the not found exceptionpublic static void addBeanRegistryToContext(ClassPool classPool, CtClass ctClass) throws CannotCompileException, NotFoundException
classPool - the class poolctClass - the ct classCannotCompileException - the cannot compile exceptionNotFoundException - the not found exceptionpublic static void transformGet1(ClassPool classPool, CtClass ctClass) throws CannotCompileException, NotFoundException
public T get(Contextual contextual); classPool - the class poolctClass - the ct classCannotCompileException - the cannot compile exceptionNotFoundException - the not found exceptionpublic static void transformGet2(ClassPool classPool, CtClass ctClass) throws CannotCompileException, NotFoundException
public T get(Contextual contextual, CreationalContext creationalContext); classPool - the class poolctClass - the ct classCannotCompileException - the cannot compile exceptionNotFoundException - the not found exceptionpublic static List<Object> getBeanInstances(javax.enterprise.inject.spi.Bean<?> bean)
bean - the beanpublic static void registerContextClass(Class<? extends Annotation> scope, Class<? extends javax.enterprise.context.spi.Context> contextClass)
scope - the scopecontextClass - the context classpublic static Class<? extends javax.enterprise.context.spi.Context> getContextClass(Class<? extends Annotation> scope)
scope - the scopepublic static boolean isRegisteredScope(Class<? extends Annotation> scope)
scope - the scopepublic static void registerExtraContext(HaCdiExtraContext extraContext)
extraContext - the extra contextpublic static void unregisterExtraContext(HaCdiExtraContext extraContext)
extraContext - the extra contextCopyright © 2020. All rights reserved.