|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.deployment.xml.helper.MetadataMerge
public final class MetadataMerge
This class merge the information of the struct representing EJB DD into the metadata.
Field Summary | |
---|---|
private EjbJarAnnotationMetadata |
ejbMetadata
Metadata for an ejb-jar. |
static java.lang.String |
JAVA_LANG_OBJECT
Defines java.lang.Object class. |
private static JLog |
logger
Logger. |
private static java.lang.String |
WILDCARD
Wildcard attribute. |
Constructor Summary | |
---|---|
private |
MetadataMerge(EjbJarAnnotationMetadata ejbMetadata)
Helper class, no public constructor. |
Method Summary | |
---|---|
private void |
addInterceptorForClass(ClassAnnotationMetadata classAnnotationMetadata,
java.lang.String interceptorClassName)
Adds a link on the given class to the interceptor class. |
private void |
applyAroundInvoke(java.util.List<AroundInvoke> aroundInvokeList,
ClassAnnotationMetadata classAnnotationMetadata,
java.lang.String type)
Apply rules for a common bean (method callbacks). |
private void |
applyCommonBean(AbsBean bean,
ClassAnnotationMetadata classAnnotationMetadata)
Apply rules for a common bean. |
private void |
applyEjbLocalRef(java.util.List<EJBLocalRef> ejbLocalRefList,
ClassAnnotationMetadata classAnnotationMetadata)
Apply rules for a common bean (ejb-local-ref). |
private void |
applyEjbRef(java.util.List<EJBRef> ejbRefList,
ClassAnnotationMetadata classAnnotationMetadata)
Apply rules for a common bean (ejb-ref). |
private void |
applyInterceptor(java.lang.String type,
java.lang.String interceptorClassName,
java.lang.String methodName,
ClassAnnotationMetadata classAnnotationMetadata)
Finds a method in the interceptor class and set the correct type value. |
private void |
applyInterceptors(Interceptors interceptors)
Apply rules for the interceptors defined in the XML DD. |
private static void |
applyJEJB(JEjbEJB jEJB,
ClassAnnotationMetadata classAnnotationMetadata,
java.util.List<InjectionTarget> injectionTargetList)
Adds the given @ EJB object to the class and apply it also on injection target elements. |
private void |
applyJndiEnvironmentRefsGroup(AbsEnvironment envGroup,
ClassAnnotationMetadata classAnnotationMetadata)
Apply rules for a an environment. |
private static void |
applyJResource(JAnnotationResource jResource,
ClassAnnotationMetadata classAnnotationMetadata,
java.util.List<InjectionTarget> injectionTargetList)
Adds the given @ Resource object to the class and apply it also on injection target elements. |
private void |
applyLifeCycle(java.util.List<LifeCycleCallback> lifecycleList,
ClassAnnotationMetadata classAnnotationMetadata,
java.lang.String type)
Apply rules for a common bean (lifecycle callbacks). |
private void |
applyResourceEnvRef(java.util.List<ResourceEnvRef> resourceEnvRefList,
ClassAnnotationMetadata classAnnotationMetadata)
Apply rules for a common bean (resource-env-ref). |
private void |
applyResourceRef(java.util.List<ResourceRef> resourceRefList,
ClassAnnotationMetadata classAnnotationMetadata)
Apply rules for a common bean (resource-ref). |
private void |
applySessionBean(Session sessionbean,
ClassAnnotationMetadata classAnnotationMetadata)
Apply rules for a session bean. |
private static JEjbEJB |
buildEJB(AbsEJBRef ref)
Build an @ EJB impl for the given ejb-ref/ejb-local-ref. |
private static java.lang.String |
encode(java.lang.String className)
Encode a classname (replace . |
private ClassAnnotationMetadata |
findClassForEjb(java.lang.String ejbName,
java.lang.String ejbClass)
Find/Gets a classAnnotationMetadata for a given ejb name and/or a given ejbclass name. |
private static FieldAnnotationMetadata |
getField(ClassAnnotationMetadata classAnnotationMetadata,
InjectionTarget injectionTarget)
Gets the field metadata for a given injection target. |
private static java.util.List<MethodAnnotationMetadata> |
getMethodsForGivenMethodDD(MethodDD methodDD,
ClassAnnotationMetadata classAnnotationMetadata)
Gets the methods metadata that are matching a given method DD. |
static void |
merge(EjbJarAnnotationMetadata ejbMetadata)
Takes struct of metadata and adds/set information on class/methods metadata. |
void |
mergeApplicationException(AssemblyDescriptor assemblyDescriptor)
Set/override the current application-exception. |
void |
mergeInterceptorBinding(AssemblyDescriptor assemblyDescriptor)
Set/override the current interceptor-binding. |
private void |
resolve()
Do all merging operations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String WILDCARD
public static final java.lang.String JAVA_LANG_OBJECT
private EjbJarAnnotationMetadata ejbMetadata
private static JLog logger
Constructor Detail |
---|
private MetadataMerge(EjbJarAnnotationMetadata ejbMetadata)
ejbMetadata
- the metadata corresponding to an EJB-JAR file.Method Detail |
---|
public static void merge(EjbJarAnnotationMetadata ejbMetadata)
ejbMetadata
- the metadata corresponding to an EJB-JAR file.private void resolve()
private void applyInterceptors(Interceptors interceptors)
interceptors
- the interceptors struct representing
<interceptors> elementprivate void applySessionBean(Session sessionbean, ClassAnnotationMetadata classAnnotationMetadata)
sessionbean
- the struct (XML DD)classAnnotationMetadata
- (Annotation metadata)private void applyCommonBean(AbsBean bean, ClassAnnotationMetadata classAnnotationMetadata)
bean
- the struct (XML DD)classAnnotationMetadata
- (Annotation metadata)private void applyJndiEnvironmentRefsGroup(AbsEnvironment envGroup, ClassAnnotationMetadata classAnnotationMetadata)
envGroup
- the struct (XML DD)classAnnotationMetadata
- (Annotation metadata)private void applyResourceRef(java.util.List<ResourceRef> resourceRefList, ClassAnnotationMetadata classAnnotationMetadata)
resourceRefList
- the list of resource-ref.classAnnotationMetadata
- (Annotation metadata) of the bean using
this interceptor (may be null).private void applyResourceEnvRef(java.util.List<ResourceEnvRef> resourceEnvRefList, ClassAnnotationMetadata classAnnotationMetadata)
resourceEnvRefList
- the list of resource-env-ref.classAnnotationMetadata
- (Annotation metadata) of the bean using
this interceptor (may be null).private void applyEjbRef(java.util.List<EJBRef> ejbRefList, ClassAnnotationMetadata classAnnotationMetadata)
ejbRefList
- the list of ejb-ref.classAnnotationMetadata
- (Annotation metadata) of the bean using
this interceptor (may be null).private void applyEjbLocalRef(java.util.List<EJBLocalRef> ejbLocalRefList, ClassAnnotationMetadata classAnnotationMetadata)
ejbLocalRefList
- the list of ejb-local-ref.classAnnotationMetadata
- (Annotation metadata) of the bean using
this interceptor (may be null).private static void applyJResource(JAnnotationResource jResource, ClassAnnotationMetadata classAnnotationMetadata, java.util.List<InjectionTarget> injectionTargetList)
Resource
object to the class and apply it also on injection target elements.
jResource
- an @Resource
implclassAnnotationMetadata
- the bean's classinjectionTargetList
- the list of injection fields to setprivate static FieldAnnotationMetadata getField(ClassAnnotationMetadata classAnnotationMetadata, InjectionTarget injectionTarget)
classAnnotationMetadata
- the class used to search the target
elementinjectionTarget
- the given target info element
private static void applyJEJB(JEjbEJB jEJB, ClassAnnotationMetadata classAnnotationMetadata, java.util.List<InjectionTarget> injectionTargetList)
EJB
object to the class and apply it also on injection target elements.
jEJB
- an @EJB
implclassAnnotationMetadata
- the bean's classinjectionTargetList
- the list of injection fields to setprivate static JEjbEJB buildEJB(AbsEJBRef ref)
EJB
impl for the given ejb-ref/ejb-local-ref.
ref
- an instance of a ejb-ref/ejb-local-ref.
EJB
interface.private void applyAroundInvoke(java.util.List<AroundInvoke> aroundInvokeList, ClassAnnotationMetadata classAnnotationMetadata, java.lang.String type)
aroundInvokeList
- the list of method/aroundInvoke callbacks.classAnnotationMetadata
- (Annotation metadata) of the bean using
this interceptor (may be null).type
- the type of lifecycle.private void applyLifeCycle(java.util.List<LifeCycleCallback> lifecycleList, ClassAnnotationMetadata classAnnotationMetadata, java.lang.String type)
lifecycleList
- the list of lifecycle callbacks.classAnnotationMetadata
- (Annotation metadata) of the bean using
this interceptor (may be null).type
- the type of lifecycle.private void addInterceptorForClass(ClassAnnotationMetadata classAnnotationMetadata, java.lang.String interceptorClassName)
classAnnotationMetadata
- the class that will use/import the
interceptorinterceptorClassName
- the interceptor class.private void applyInterceptor(java.lang.String type, java.lang.String interceptorClassName, java.lang.String methodName, ClassAnnotationMetadata classAnnotationMetadata)
type
- type of interceptorinterceptorClassName
- the name of the interceptor classmethodName
- the name of the method in the interceptor classclassAnnotationMetadata
- the class that is using the interceptor (may be null)private ClassAnnotationMetadata findClassForEjb(java.lang.String ejbName, java.lang.String ejbClass)
ejbName
- the name of the EJB.ejbClass
- the class of the EJB.
public void mergeApplicationException(AssemblyDescriptor assemblyDescriptor)
assemblyDescriptor
- the given assembly descriptor to analyze.public void mergeInterceptorBinding(AssemblyDescriptor assemblyDescriptor)
assemblyDescriptor
- the given assembly descriptor to analyze.private static java.util.List<MethodAnnotationMetadata> getMethodsForGivenMethodDD(MethodDD methodDD, ClassAnnotationMetadata classAnnotationMetadata)
methodDD
- the methodDD objectclassAnnotationMetadata
- the class where to search methods.
private static java.lang.String encode(java.lang.String className)
className
- the name of the class to encode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |