com.bm.ejb3metadata.annotations.metadata
Class MethodAnnotationMetadata

java.lang.Object
  extended by com.bm.ejb3metadata.annotations.metadata.CommonAnnotationMetadata
      extended by com.bm.ejb3metadata.annotations.metadata.MethodAnnotationMetadata
All Implemented Interfaces:
IAnnotationResource, IEjbEJB, IEJBInterceptors, IPersistenceContext, IPersistenceUnit, ISharedMetadata, ITransactionAttribute, java.lang.Cloneable

public class MethodAnnotationMetadata
extends CommonAnnotationMetadata
implements java.lang.Cloneable, ITransactionAttribute, IEJBInterceptors

This class represents the annotation metadata of a method.

Author:
Daniel Wiese

Constructor Summary
MethodAnnotationMetadata(JMethod jMethod, ClassAnnotationMetadata classAnnotationMetadata)
          Constructor.
 
Method Summary
 java.lang.Object clone()
           
 JInterceptors getAnnotationInterceptors()
           
 ClassAnnotationMetadata getClassAnnotationMetadata()
           
 java.util.List<JClassInterceptor> getGlobalEasyBeansInterceptors()
           
 java.util.List<JClassInterceptor> getInterceptors()
           
 JMethod getJMethod()
           
 Remove getJRemove()
           
 java.lang.String getMethodName()
           
 ClassAnnotationMetadata getOriginalClassAnnotationMetadata()
           
 TransactionAttributeType getTransactionAttributeType()
           
 java.util.Map<InterceptorType,java.util.List<JClassInterceptor>> getUserEasyBeansInterceptors()
           
 boolean isAroundInvoke()
           
 boolean isBusinessMethod()
           
 boolean isExcludedClassInterceptors()
           
 boolean isInherited()
           
 boolean isLifeCycleMethod()
           
 boolean isPostActivate()
           
 boolean isPostConstruct()
           
 boolean isPreDestroy()
           
 boolean isPrePassivate()
           
 boolean isTimeout()
           
 void setAnnotationsInterceptors(JInterceptors annotationInterceptors)
          Sets the object representing the @Interceptors annotation.
 void setAroundInvoke(boolean aroundInvoke)
          Sets true if method has @AroundInvoke.
 void setBusinessMethod(boolean flag)
          This method is a business method.
 void setClassAnnotationMetadata(ClassAnnotationMetadata classAnnotationMetadata)
          Replace the link to the classannotation metadata.
 void setExcludeClassInterceptors(boolean excludeClassInterceptors)
          Flag this method as a method which exclude user interceptors.
 void setGlobalEasyBeansInterceptors(java.util.List<JClassInterceptor> globalEasyBeansInterceptors)
          Sets the list of global interceptors that enhancers will use.
 void setInherited(boolean inherited, ClassAnnotationMetadata originalClassAnnotationMetadata)
          Sets the inheritance of this method.
 void setInterceptors(java.util.List<JClassInterceptor> interceptors)
          Sets the list of interceptors(tx, security, etc) that enhancers will use.
These interceptors are defined per methods.
 void setPostActivate(boolean postActivate)
          Sets true if method has @PostActivate.
 void setPostConstruct(boolean postConstruct)
          Sets true if method has @PostConstruct.
 void setPreDestroy(boolean preDestroy)
          Sets true if method has @PreDestroy.
 void setPrePassivate(boolean prePassivate)
          Sets true if method has @PrePassivate.
 void setRemove(Remove remove)
          Sets @Remove attribute.
 void setTimeout(boolean timeout)
          Sets true if method has @Timeout.
 void setTransactionAttributeType(TransactionAttributeType transactionAttributeType)
          Sets Transaction Attribute Type.
 void setUserInterceptors(java.util.Map<InterceptorType,java.util.List<JClassInterceptor>> userInterceptors)
          Sets the list of user interceptors that enhancers will use.
These interceptors are defined in bean class.
 java.lang.String toString()
           
 
Methods inherited from class com.bm.ejb3metadata.annotations.metadata.CommonAnnotationMetadata
concatStringBuilder, concatStringBuilder, getJAnnotationResource, getJavaxPersistenceContext, getJavaxPersistenceUnit, getJEjbEJB, isPersistenceContext, isPersistenceUnit, setJAnnotationResource, setJavaxPersistenceContext, setJavaxPersistenceUnit, setJEjbEJB
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodAnnotationMetadata

public MethodAnnotationMetadata(JMethod jMethod,
                                ClassAnnotationMetadata classAnnotationMetadata)
Constructor.

Parameters:
jMethod - the method on which we will set/add metadata
classAnnotationMetadata - the parent metadata.
Method Detail

getMethodName

public java.lang.String getMethodName()
Returns:
name of the method

getJMethod

public JMethod getJMethod()
Returns:
JMethod object

getTransactionAttributeType

public TransactionAttributeType getTransactionAttributeType()
Specified by:
getTransactionAttributeType in interface ITransactionAttribute
Returns:
transaction Attribute type.
See Also:
TransactionAttributeType

setTransactionAttributeType

public void setTransactionAttributeType(TransactionAttributeType transactionAttributeType)
Sets Transaction Attribute Type.

Specified by:
setTransactionAttributeType in interface ITransactionAttribute
Parameters:
transactionAttributeType - the type of transaction.
See Also:
TransactionAttributeType

isBusinessMethod

public boolean isBusinessMethod()
Returns:
true if the method is a business method.

setBusinessMethod

public void setBusinessMethod(boolean flag)
This method is a business method.

Parameters:
flag - true/false if method is a business method.

isLifeCycleMethod

public boolean isLifeCycleMethod()
Returns:
true if the method is a lifecycle method.

getJRemove

public Remove getJRemove()
Returns:
remove attributes @Remove attributes

setRemove

public void setRemove(Remove remove)
Sets @Remove attribute.

Parameters:
remove - contains the attribute with retainIfException.

toString

public java.lang.String toString()
Overrides:
toString in class CommonAnnotationMetadata
Returns:
string representation

isPostActivate

public boolean isPostActivate()
Returns:
true if method has @PostActivate

setPostActivate

public void setPostActivate(boolean postActivate)
Sets true if method has @PostActivate.

Parameters:
postActivate - true/false.

isPostConstruct

public boolean isPostConstruct()
Returns:
true if method has @PostConstruct.

setPostConstruct

public void setPostConstruct(boolean postConstruct)
Sets true if method has @PostConstruct.

Parameters:
postConstruct - true/false.

isPreDestroy

public boolean isPreDestroy()
Returns:
true if method has @PreDestroy.

setPreDestroy

public void setPreDestroy(boolean preDestroy)
Sets true if method has @PreDestroy.

Parameters:
preDestroy - true/false.

isPrePassivate

public boolean isPrePassivate()
Returns:
true if method has @PrePassivate.

setPrePassivate

public void setPrePassivate(boolean prePassivate)
Sets true if method has @PrePassivate.

Parameters:
prePassivate - true/false.

isTimeout

public boolean isTimeout()
Returns:
true if method has @Timeout.

setTimeout

public void setTimeout(boolean timeout)
Sets true if method has @Timeout.

Parameters:
timeout - true/false.

isAroundInvoke

public boolean isAroundInvoke()
Returns:
true if method has @AroundInvoke.

setAroundInvoke

public void setAroundInvoke(boolean aroundInvoke)
Sets true if method has @AroundInvoke.

Parameters:
aroundInvoke - true/false

isInherited

public boolean isInherited()
Returns:
true if this method is inherited from a super class

setInherited

public void setInherited(boolean inherited,
                         ClassAnnotationMetadata originalClassAnnotationMetadata)
Sets the inheritance of this method.

Parameters:
inherited - true if method is from a super class
originalClassAnnotationMetadata - the metadata of the original class (not inherited)

isExcludedClassInterceptors

public boolean isExcludedClassInterceptors()
Returns:
true if this method won't use user interceptors.

setExcludeClassInterceptors

public void setExcludeClassInterceptors(boolean excludeClassInterceptors)
Flag this method as a method which exclude user interceptors.

Parameters:
excludeClassInterceptors - true if this method is a method which exclude user interceptors.

getClassAnnotationMetadata

public ClassAnnotationMetadata getClassAnnotationMetadata()
Returns:
parent metadata (class)

getOriginalClassAnnotationMetadata

public ClassAnnotationMetadata getOriginalClassAnnotationMetadata()
Returns:
original parent metadata (class) if inherited.

getInterceptors

public java.util.List<JClassInterceptor> getInterceptors()
Returns:
list of interceptors that enhancer will use. (ie : security/transaction)

setInterceptors

public void setInterceptors(java.util.List<JClassInterceptor> interceptors)
Sets the list of interceptors(tx, security, etc) that enhancers will use.
These interceptors are defined per methods.

Parameters:
interceptors - list of interceptors that enhancer will use.

getAnnotationInterceptors

public JInterceptors getAnnotationInterceptors()
Returns:
object representing list of @Interceptors.

setAnnotationsInterceptors

public void setAnnotationsInterceptors(JInterceptors annotationInterceptors)
Sets the object representing the @Interceptors annotation.

Specified by:
setAnnotationsInterceptors in interface IEJBInterceptors
Parameters:
annotationInterceptors - list of classes

getUserEasyBeansInterceptors

public java.util.Map<InterceptorType,java.util.List<JClassInterceptor>> getUserEasyBeansInterceptors()
Returns:
Map<interceptor type <--> List of methods/class corresponding to the interceptor> of user interceptors that enhancer will use.

setUserInterceptors

public void setUserInterceptors(java.util.Map<InterceptorType,java.util.List<JClassInterceptor>> userInterceptors)
Sets the list of user interceptors that enhancers will use.
These interceptors are defined in bean class.

Parameters:
userInterceptors - list of interceptors that enhancer will use.

getGlobalEasyBeansInterceptors

public java.util.List<JClassInterceptor> getGlobalEasyBeansInterceptors()
Returns:
list of global interceptors that enhancer will use. (ie : Remove interceptor)

setGlobalEasyBeansInterceptors

public void setGlobalEasyBeansInterceptors(java.util.List<JClassInterceptor> globalEasyBeansInterceptors)
Sets the list of global interceptors that enhancers will use.

Parameters:
globalEasyBeansInterceptors - list of interceptors that enhancer will use.

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object
Returns:
a clone object.

setClassAnnotationMetadata

public void setClassAnnotationMetadata(ClassAnnotationMetadata classAnnotationMetadata)
Replace the link to the classannotation metadata.

Parameters:
classAnnotationMetadata - new object for the link.


Copyright © 2008. All Rights Reserved.