org.jboss.kernel.plugins.annotations
Class LifecycleParameterAnnotationPlugin<C extends Annotation>

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.kernel.plugins.annotations.BaseMetaDataAnnotationPlugin<T,C>
          extended by org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin<T,C>
              extended by org.jboss.kernel.plugins.annotations.AbstractAdaptersAnnotationPlugin<T,C>
                  extended by org.jboss.kernel.plugins.annotations.AbstractParameterAnnotationPlugin<org.jboss.reflect.spi.MethodInfo,C,P>
                      extended by org.jboss.kernel.plugins.annotations.AbstractMethodParameterAnnotationPlugin<C,AbstractLifecycleMetaData>
                          extended by org.jboss.kernel.plugins.annotations.LifecycleParameterAnnotationPlugin<C>
Type Parameters:
C - annotation type
All Implemented Interfaces:
Cloneable, AnnotationPlugin<org.jboss.reflect.spi.MethodInfo,C>, MetaDataAnnotationPlugin<org.jboss.reflect.spi.MethodInfo,C>, org.jboss.util.JBossInterface
Direct Known Subclasses:
CreateLifecycleAnnotationPlugin, DestroyLifecycleAnnotationPlugin, StartLifecycleAnnotationPlugin, StopLifecycleAnnotationPlugin

public abstract class LifecycleParameterAnnotationPlugin<C extends Annotation>
extends AbstractMethodParameterAnnotationPlugin<C,AbstractLifecycleMetaData>

Abstract lifecycle annotation plugin.

Author:
Ales Justin

Field Summary
 
Fields inherited from class org.jboss.kernel.plugins.annotations.AbstractAdaptersAnnotationPlugin
adapters
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
protected LifecycleParameterAnnotationPlugin(Class<C> annotation, Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
           
 
Method Summary
protected abstract  void applyLifecycleAnnotation(AbstractLifecycleMetaData lifecycle, C annotation)
          Apply lifecycle annotation.
protected  boolean checkAnnotatedInfo(ElementType type)
          Check additional element type - apart from Parameter element type.
protected  AbstractLifecycleMetaData createLifecycleMetaData(String method, C annotation)
           
protected  AbstractLifecycleMetaData createParametrizedMetaData(org.jboss.reflect.spi.MethodInfo info, C annotation)
          Create new Parametrized metadata.
protected  org.jboss.reflect.spi.ParameterInfo[] getParameters(org.jboss.reflect.spi.MethodInfo info)
          Get the parameters infos from type.
protected  List<? extends MetaDataVisitorNode> handleParameterlessInfo(org.jboss.reflect.spi.MethodInfo info, C annotation, BeanMetaData beanMetaData)
          Handle info which has zero parameters.
protected abstract  boolean isLifecyclePresent(BeanMetaData beanMetaData)
          Is lifecycle metadata present.
protected  boolean isMetaDataAlreadyPresent(org.jboss.reflect.spi.MethodInfo info, C annotation, BeanMetaData beanMetaData)
          Is meta data already present.
protected abstract  void setLifecycleMetaData(AbstractBeanMetaData beanMetaData, AbstractLifecycleMetaData lifecycle)
          Set lifecycle metadata.
protected  void setParameterizedMetaData(AbstractLifecycleMetaData parameterizedMetaData, BeanMetaData beanMetaData)
          Set the ParameterizedMetaData instance.
 
Methods inherited from class org.jboss.kernel.plugins.annotations.AbstractMethodParameterAnnotationPlugin
createParametersSignature
 
Methods inherited from class org.jboss.kernel.plugins.annotations.AbstractParameterAnnotationPlugin
createParametrizedMetaData, createParametrizedMetaData, internalApplyAnnotation, isElementTypeSupported
 
Methods inherited from class org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin
applyAnnotation, checkIfNotAbstractBeanMetaDataSpecific, cleanAnnotation, internalApplyAnnotation, internalApplyAnnotation, internalCleanAnnotation, isMetaDataAlreadyPresent
 
Methods inherited from class org.jboss.kernel.plugins.annotations.BaseMetaDataAnnotationPlugin
applyAnnotation, getAnnotation, getSupportedTypes, isAttributePresent, isAttributePresent, isCleanup, isCleanupOnly, toShortString, toString
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.kernel.plugins.annotations.MetaDataAnnotationPlugin
applyAnnotation, getAnnotation, getSupportedTypes
 

Constructor Detail

LifecycleParameterAnnotationPlugin

protected LifecycleParameterAnnotationPlugin(Class<C> annotation,
                                             Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
Method Detail

checkAnnotatedInfo

protected boolean checkAnnotatedInfo(ElementType type)
Description copied from class: AbstractParameterAnnotationPlugin
Check additional element type - apart from Parameter element type.

Specified by:
checkAnnotatedInfo in class AbstractParameterAnnotationPlugin<org.jboss.reflect.spi.MethodInfo,C extends Annotation,AbstractLifecycleMetaData>
Parameters:
type - the type
Returns:
true if additional type is supported

isLifecyclePresent

protected abstract boolean isLifecyclePresent(BeanMetaData beanMetaData)
Is lifecycle metadata present.

Parameters:
beanMetaData - the bean metadata
Returns:
true if lifecycle metadata exists

createLifecycleMetaData

protected AbstractLifecycleMetaData createLifecycleMetaData(String method,
                                                            C annotation)

applyLifecycleAnnotation

protected abstract void applyLifecycleAnnotation(AbstractLifecycleMetaData lifecycle,
                                                 C annotation)
Apply lifecycle annotation.

Parameters:
lifecycle - lifecycle metadata
annotation - the annotation

setLifecycleMetaData

protected abstract void setLifecycleMetaData(AbstractBeanMetaData beanMetaData,
                                             AbstractLifecycleMetaData lifecycle)
Set lifecycle metadata.

Parameters:
beanMetaData - the bean metadata
lifecycle - the lifecycle metadata

isMetaDataAlreadyPresent

protected boolean isMetaDataAlreadyPresent(org.jboss.reflect.spi.MethodInfo info,
                                           C annotation,
                                           BeanMetaData beanMetaData)
Description copied from class: BaseMetaDataAnnotationPlugin
Is meta data already present.

Overrides:
isMetaDataAlreadyPresent in class BaseMetaDataAnnotationPlugin<org.jboss.reflect.spi.MethodInfo,C extends Annotation>
Parameters:
info - the info
annotation - the annotation
beanMetaData - the bean meta data
Returns:
true if meta data already present

getParameters

protected org.jboss.reflect.spi.ParameterInfo[] getParameters(org.jboss.reflect.spi.MethodInfo info)
Description copied from class: AbstractParameterAnnotationPlugin
Get the parameters infos from type.

Specified by:
getParameters in class AbstractParameterAnnotationPlugin<org.jboss.reflect.spi.MethodInfo,C extends Annotation,AbstractLifecycleMetaData>
Parameters:
info - the type
Returns:
array of parameter info

handleParameterlessInfo

protected List<? extends MetaDataVisitorNode> handleParameterlessInfo(org.jboss.reflect.spi.MethodInfo info,
                                                                      C annotation,
                                                                      BeanMetaData beanMetaData)
Description copied from class: AbstractParameterAnnotationPlugin
Handle info which has zero parameters.

Specified by:
handleParameterlessInfo in class AbstractParameterAnnotationPlugin<org.jboss.reflect.spi.MethodInfo,C extends Annotation,AbstractLifecycleMetaData>
Parameters:
info - the info
annotation - the annotation
beanMetaData - the bean metadata
Returns:
list of added meta data visitor nodes

createParametrizedMetaData

protected AbstractLifecycleMetaData createParametrizedMetaData(org.jboss.reflect.spi.MethodInfo info,
                                                               C annotation)
Description copied from class: AbstractParameterAnnotationPlugin
Create new Parametrized metadata.

Overrides:
createParametrizedMetaData in class AbstractParameterAnnotationPlugin<org.jboss.reflect.spi.MethodInfo,C extends Annotation,AbstractLifecycleMetaData>
Parameters:
info - the info
annotation - the annotation
Returns:
new ParameterizedMetaData instance

setParameterizedMetaData

protected void setParameterizedMetaData(AbstractLifecycleMetaData parameterizedMetaData,
                                        BeanMetaData beanMetaData)
Description copied from class: AbstractParameterAnnotationPlugin
Set the ParameterizedMetaData instance.

Specified by:
setParameterizedMetaData in class AbstractParameterAnnotationPlugin<org.jboss.reflect.spi.MethodInfo,C extends Annotation,AbstractLifecycleMetaData>
Parameters:
parameterizedMetaData - the parameterized metadata
beanMetaData - the bean metadata


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.