org.jboss.kernel.plugins.annotations
Class CallbackAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,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.CallbackAnnotationPlugin<T,C>
Type Parameters:
T - info type
C - annotation type
All Implemented Interfaces:
Cloneable, AnnotationPlugin<T,C>, MetaDataAnnotationPlugin<T,C>, org.jboss.util.JBossInterface
Direct Known Subclasses:
InstallCallbackAnnotationPlugin, InstallFieldCallbackAnnotationPlugin, UninstallCallbackAnnotationPlugin, UninstallFieldCallbackAnnotationPlugin

public abstract class CallbackAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
extends AbstractAnnotationPlugin<T,C>

Callback annotation plugin.

Author:
Ales Justin

Field Summary
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
protected CallbackAnnotationPlugin(Class<C> annotation)
           
 
Method Summary
protected abstract  void applyInfo(AbstractCallbackMetaData callback, T info)
          Apply additional information.
protected abstract  AbstractCallbackMetaData createCallback(T info, C annotation)
          Create new CallbackMetaData instance.
protected abstract  List<CallbackMetaData> getCallbacks(AbstractBeanMetaData beanMetaData)
          Get the callback metadatas.
protected abstract  Set<CallbackItem<?>> getCallbacks(DependencyInfo dependency)
          Get the callbacks.
protected  List<? extends MetaDataVisitorNode> internalApplyAnnotation(T info, C annotation, BeanMetaData bmd)
          Covariant override.
protected  boolean isElementTypeSupported(ElementType type)
          Is type supported by plugin.
protected abstract  boolean isEqual(T info, CallbackItem<?> ci)
          Does callback item corespond to info instance.
protected  boolean isMetaDataAlreadyPresent(T info, C annotation, KernelControllerContext context)
          Is meta data already present.
 
Methods inherited from class org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin
applyAnnotation, checkIfNotAbstractBeanMetaDataSpecific, cleanAnnotation, internalApplyAnnotation, internalApplyAnnotation, internalCleanAnnotation
 
Methods inherited from class org.jboss.kernel.plugins.annotations.BaseMetaDataAnnotationPlugin
applyAnnotation, getAnnotation, getSupportedTypes, isAttributePresent, isAttributePresent, isCleanup, isCleanupOnly, isMetaDataAlreadyPresent, 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

CallbackAnnotationPlugin

protected CallbackAnnotationPlugin(Class<C> annotation)
Method Detail

isElementTypeSupported

protected boolean isElementTypeSupported(ElementType type)
Description copied from class: BaseMetaDataAnnotationPlugin
Is type supported by plugin.

Specified by:
isElementTypeSupported in class BaseMetaDataAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
Parameters:
type - the annotation element type
Returns:
true if element supported

isMetaDataAlreadyPresent

protected boolean isMetaDataAlreadyPresent(T info,
                                           C annotation,
                                           KernelControllerContext context)
Description copied from class: AbstractAnnotationPlugin
Is meta data already present.

Overrides:
isMetaDataAlreadyPresent in class AbstractAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
Parameters:
info - the info
annotation - the annotation
context - the context
Returns:
true if meta data already present

isEqual

protected abstract boolean isEqual(T info,
                                   CallbackItem<?> ci)
Does callback item corespond to info instance.

Parameters:
info - the info
ci - the callback item
Returns:
true if callback matches info

getCallbacks

protected abstract Set<CallbackItem<?>> getCallbacks(DependencyInfo dependency)
Get the callbacks.

Parameters:
dependency - the dependency info
Returns:
set of callback items

internalApplyAnnotation

protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(T info,
                                                                      C annotation,
                                                                      BeanMetaData bmd)
Description copied from class: AbstractAnnotationPlugin
Covariant override.

Overrides:
internalApplyAnnotation in class AbstractAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
Parameters:
info - the info
annotation - the annotation
bmd - the bean meta data
Returns:
used to return covariant type

createCallback

protected abstract AbstractCallbackMetaData createCallback(T info,
                                                           C annotation)
Create new CallbackMetaData instance.

Parameters:
info - the info
annotation - the annotation
Returns:
new CallbackMetaData instance

applyInfo

protected abstract void applyInfo(AbstractCallbackMetaData callback,
                                  T info)
Apply additional information.

Parameters:
callback - the callback metadata
info - the info

getCallbacks

protected abstract List<CallbackMetaData> getCallbacks(AbstractBeanMetaData beanMetaData)
Get the callback metadatas.

Parameters:
beanMetaData - the bean metadata
Returns:
list of callback metadatas


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