com.sun.enterprise.deployment.annotation.handlers
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:
- DataSourceDefinitionHandler, DataSourceDefinitionsHandler, EntityManagerFactoryReferenceHandler, EntityManagerReferenceHandler, 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
| Methods inherited from class com.sun.enterprise.deployment.annotation.handlers.AbstractHandler |
getConnectorAnnotationTypes, getDefaultFailedResult, getDefaultProcessedResult, getEjbAndWebAnnotationTypes, getEjbAnnotationTypes, getInjectionMethodPropertyName, getInvalidAnnotatedElementHandlerResult, getOverallProcessingResult, getWebAnnotationTypes, log, validateInjectionMethod |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractResourceHandler
public AbstractResourceHandler()
processAnnotation
protected abstract HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
ResourceContainerContext[] rcContexts)
throws AnnotationProcessorException
- Process Annotation with given ResourceContainerContexts.
- Parameters:
ainfo - rcContexts -
- 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
getTypeDependencies
public java.lang.Class<? extends java.lang.annotation.Annotation>[] getTypeDependencies()
- Specified by:
getTypeDependencies in interface AnnotationHandler- Overrides:
getTypeDependencies in class AbstractHandler
- Returns:
- an array of annotation types this annotation handler would
require to be processed (if present) before it processes it's own
annotation type.
Copyright © 2012 GlassFish Community. All Rights Reserved.