Class AbstractCommonAttributeHandler
- java.lang.Object
-
- com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
-
- com.sun.enterprise.deployment.annotation.handlers.AbstractCommonAttributeHandler
-
- All Implemented Interfaces:
AnnotationHandler
- Direct Known Subclasses:
DeclareRolesHandler
,DenyAllHandler
,PermitAllHandler
,RolesAllowedHandler
,RunAsHandler
public abstract class AbstractCommonAttributeHandler extends AbstractHandler
This is an abstract class encapsulate generic behaviour of annotation handler applying on Ejb and WebComponent Class. It will get the corresponding EjbDescriptors or WebComponentDescriptor associated to the annotation on the given 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; protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebComponentContext[] webCompContexts) throws AnnotationProcessorException; protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebBundleContext webBundleContext) throws AnnotationProcessorException; It may also need to override the following if other annotations need to be processed prior to given annotation: public Class<? extends Annotation>[] getTypeDependencies();- Author:
- Shing Wai Chan
-
-
Field Summary
-
Fields inherited from class com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
ejbProvider, localStrings, logger
-
Fields inherited from interface org.glassfish.apf.AnnotationHandler
ANNOTATION_HANDLER_METADATA
-
-
Constructor Summary
Constructors Constructor Description AbstractCommonAttributeHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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 abstract HandlerProcessingResult
processAnnotation(AnnotationInfo ainfo, WebBundleContext webBundleContext)
Process Annotation with given WebBundleContext.protected abstract HandlerProcessingResult
processAnnotation(AnnotationInfo ainfo, WebComponentContext[] webCompContexts)
Process Annotation with given WebCompContexts.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
getAnnotationType, getConnectorAnnotationTypes, getDefaultFailedResult, getDefaultProcessedResult, getEjbAndWebAnnotationTypes, getEjbAnnotationTypes, getInjectionMethodPropertyName, getInvalidAnnotatedElementHandlerResult, getOverallProcessingResult, getTypeDependencies, getWebAnnotationTypes, log, validateInjectionMethod
-
-
-
-
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 abstract HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebComponentContext[] webCompContexts) throws AnnotationProcessorException
Process Annotation with given WebCompContexts.- Parameters:
ainfo
-webCompContexts
-- Returns:
- HandlerProcessingResult
- Throws:
AnnotationProcessorException
-
processAnnotation
protected abstract HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebBundleContext webBundleContext) throws AnnotationProcessorException
Process Annotation with given WebBundleContext.- Parameters:
ainfo
-webBundleContext
-- 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.- Parameters:
ainfo
- the annotation information- Throws:
AnnotationProcessorException
-
supportTypeInheritance
protected boolean supportTypeInheritance()
This indicates whether the annotation type should be processed for type level in super-class.
-
-