org.glassfish.ejb.deployment.annotation.handlers
Class AbstractAttributeHandler

java.lang.Object
  extended by com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
      extended by org.glassfish.ejb.deployment.annotation.handlers.AbstractAttributeHandler
All Implemented Interfaces:
AnnotationHandler
Direct Known Subclasses:
AccessTimeoutHandler, AfterBeginHandler, AfterCompletionHandler, AroundInvokeHandler, AsynchronousHandler, BeforeCompletionHandler, ConcurrencyManagementHandler, ExcludeClassInterceptorsHandler, ExcludeDefaultInterceptorsHandler, InitHandler, InterceptorsHandler, LockHandler, PostActivateHandler, PrePassivateHandler, RemoveHandler, ScheduleHandler, StatefulTimeoutHandler, TimeoutHandler, TransactionAttributeHandler, TransactionManagementHandler

public abstract class AbstractAttributeHandler
extends AbstractHandler

This is an abstract class encapsulate generic behaviour of annotation handler applying on Ejb Class. It will get the corresponding EjbDescriptors associated to the annotation on the given Ejb Class and then pass it to underlying processAnnotation method. Concrete subclass handlers need to implement the following: public Class<? extends Annotation> getAnnotationType(); protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException; It may also need to override the following: a) if other annotations need to be processed prior to given annotation: public Class<? extends Annotation>[] getTypeDependencies(); b) if the given annotation can be processed while processing another annotation protected boolean isDelegatee(); c) if we need to process for interceptor protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbInterceptorContext ejbInterceptorContext) throws AnnotationProcessorException; d) indicate the annotation support type inheritance protected boolean supportTypeIneritance();

Author:
Shing Wai Chan

Field Summary
 
Fields inherited from class com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
ejbProvider, localStrings, logger
 
Constructor Summary
AbstractAttributeHandler()
           
 
Method Summary
protected  boolean isDelegatee()
          This indicates whether the annotation can be processed by delegation from the another annotation.
 HandlerProcessingResult processAnnotation(AnnotationInfo ainfo)
          Process a particular annotation which type is the same as the one returned by @see getAnnotationType().
protected abstract  HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts)
          Process Annotation with given EjbContexts.
protected  HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbInterceptorContext ejbInterceptorContext)
          Process Annotation with given InteceptorContext.
protected  boolean supportTypeInheritance()
          This indicates whether the annotation type should be processed for type level in super-class.
 
Methods inherited from class com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
getConnectorAnnotationTypes, getDefaultFailedResult, getDefaultProcessedResult, getEjbAndWebAnnotationTypes, getEjbAnnotationTypes, getInjectionMethodPropertyName, getInvalidAnnotatedElementHandlerResult, getOverallProcessingResult, getTypeDependencies, getWebAnnotationTypes, log, validateInjectionMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.glassfish.apf.AnnotationHandler
getAnnotationType
 

Constructor Detail

AbstractAttributeHandler

public AbstractAttributeHandler()
Method Detail

processAnnotation

protected abstract HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
                                                             EjbContext[] ejbContexts)
                                                      throws AnnotationProcessorException
Process Annotation with given EjbContexts.

Parameters:
ainfo -
ejbContexts -
Returns:
HandlerProcessingResult
Throws:
AnnotationProcessorException

processAnnotation

protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
                                                    EjbInterceptorContext ejbInterceptorContext)
                                             throws AnnotationProcessorException
Process Annotation with given InteceptorContext.

Parameters:
ainfo -
ejbInterceptorContext -
Returns:
HandlerProcessingResult
Throws:
AnnotationProcessorException

processAnnotation

public HandlerProcessingResult processAnnotation(AnnotationInfo ainfo)
                                          throws AnnotationProcessorException
Process a particular annotation which type is the same as the one returned by @see getAnnotationType(). All information pertinent to the annotation and its context is encapsulated in the passed AnnotationInfo instance. This is a method in interface AnnotationHandler.

Parameters:
ainfo - the annotation information
Throws:
AnnotationProcessorException

isDelegatee

protected boolean isDelegatee()
This indicates whether the annotation can be processed by delegation from the another annotation.


supportTypeInheritance

protected boolean supportTypeInheritance()
This indicates whether the annotation type should be processed for type level in super-class.



Copyright © 2012 GlassFish Community. All Rights Reserved.