Class AbstractResourceHandler
- java.lang.Object
-
- com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
-
- com.sun.enterprise.deployment.annotation.handlers.AbstractResourceHandler
-
- All Implemented Interfaces:
AnnotationHandler
- Direct Known Subclasses:
AdministeredObjectDefinitionHandler,AdministeredObjectDefinitionsHandler,ConnectionFactoryDefinitionHandler,ConnectionFactoryDefinitionsHandler,ContextServiceDefinitionHandler,ContextServiceDefinitionListHandler,DataSourceDefinitionHandler,DataSourceDefinitionsHandler,EJBHandler,EntityManagerFactoryReferenceHandler,EntityManagerReferenceHandler,JMSConnectionFactoryDefinitionHandler,JMSConnectionFactoryDefinitionsHandler,JMSDestinationDefinitionHandler,JMSDestinationDefinitionsHandler,MailSessionDefinitionHandler,MailSessionDefinitionsHandler,ManagedExecutorDefinitionHandler,ManagedExecutorDefinitionListHandler,ManagedScheduledExecutorDefinitionHandler,ManagedScheduledExecutorDefinitionListHandler,ManagedThreadFactoryDefinitionHandler,ManagedThreadFactoryDefinitionListHandler,PostConstructHandler,PreDestroyHandler,ResourceHandler
public abstract class AbstractResourceHandler extends AbstractHandler
This is an abstract class encapsulate generic behaviour of resource annotation. Concrete subclass handlers need to implement the following: public Class<? extends Annotation> getAnnotationType(); protected HandlerProcessingResult processAnnotation( AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) 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 AbstractResourceHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Class<? extends Annotation>[]getTypeDependencies()protected booleanisAEjbComponentClass(Annotation[] annotations)protected booleanisAWebComponentClass(Annotation[] annotations)HandlerProcessingResultprocessAnnotation(AnnotationInfo ainfo)Process a particular annotation which type is the same as the one returned by @see getAnnotationType().protected abstract HandlerProcessingResultprocessAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts)Process Annotation with given ResourceContainerContexts.protected voidvalidateAnnotatedLifecycleMethod(Method method)-
Methods inherited from class com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
getAnnotationType, getConnectorAnnotationTypes, getDefaultFailedResult, getDefaultProcessedResult, getEjbAndWebAnnotationTypes, getEjbAnnotationTypes, getInjectionMethodPropertyName, getInvalidAnnotatedElementHandlerResult, getOverallProcessingResult, getWebAnnotationTypes, log, validateInjectionMethod
-
-
-
-
Method Detail
-
processAnnotation
protected abstract HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException
Process Annotation with given ResourceContainerContexts.- Parameters:
ainfo-rcContexts-- Returns:
- 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- Returns:
- Throws:
AnnotationProcessorException
-
getTypeDependencies
public Class<? extends Annotation>[] getTypeDependencies()
- Specified by:
getTypeDependenciesin interfaceAnnotationHandler- Overrides:
getTypeDependenciesin classAbstractHandler- Returns:
- an array of annotation types this annotation handler would require to be processed (if present) before it processes it's own annotation type.
-
isAEjbComponentClass
protected boolean isAEjbComponentClass(Annotation[] annotations)
-
isAWebComponentClass
protected boolean isAWebComponentClass(Annotation[] annotations)
-
validateAnnotatedLifecycleMethod
protected void validateAnnotatedLifecycleMethod(Method method)
-
-