com.sun.enterprise.deployment.annotation.handlers
Class AbstractHandler

java.lang.Object
  extended by com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
All Implemented Interfaces:
AnnotationHandler
Direct Known Subclasses:
AbstractResourceHandler, AuthenticationMechanismHandler, DeclareRolesHandler, DenyAllHandler, ManagedBeanHandler, MultipartConfigHandler, PermitAllHandler, RolesAllowedHandler, RunAsHandler, SecurityPermissionHandler, ServletSecurityHandler, WebFilterHandler, WebListenerHandler, WebServletHandler

public abstract class AbstractHandler
extends java.lang.Object
implements AnnotationHandler

This is an abstract base class for Handlers. Concrete subclass need to implements the following methods: public Class<? extends Annotation> getAnnotationType(); public HandlerProcessingResult processAnnotation(AnnotationInfo ainfo) throws AnnotationProcessorException;

Author:
Shing Wai Chan

Field Summary
protected  AnnotationTypesProvider ejbProvider
           
protected static LocalStringManagerImpl localStrings
           
protected  java.util.logging.Logger logger
           
 
Constructor Summary
AbstractHandler()
           
 
Method Summary
protected  java.lang.Class<? extends java.lang.annotation.Annotation>[] getConnectorAnnotationTypes()
          This is called by getTypeDependencies().
protected  HandlerProcessingResult getDefaultFailedResult()
           
protected  HandlerProcessingResult getDefaultProcessedResult()
           
protected  java.lang.Class<? extends java.lang.annotation.Annotation>[] getEjbAndWebAnnotationTypes()
          This is called by getTypeDependencies().
protected  java.lang.Class<? extends java.lang.annotation.Annotation>[] getEjbAnnotationTypes()
          This is called by getTypeDependencies().
protected  java.lang.String getInjectionMethodPropertyName(java.lang.reflect.Method method, AnnotationInfo ainfo)
           
protected  HandlerProcessingResult getInvalidAnnotatedElementHandlerResult(AnnotatedElementHandler aeHandler, AnnotationInfo ainfo)
           
protected  HandlerProcessingResult getOverallProcessingResult(java.util.List<HandlerProcessingResult> resultList)
           
 java.lang.Class<? extends java.lang.annotation.Annotation>[] getTypeDependencies()
           
protected  java.lang.Class<? extends java.lang.annotation.Annotation>[] getWebAnnotationTypes()
          This is called by getTypeDependencies().
protected  void log(java.util.logging.Level level, AnnotationInfo ainfo, java.lang.String localizedMessage)
           
protected  void validateInjectionMethod(java.lang.reflect.Method method, AnnotationInfo ainfo)
          Check if given method is a valid injection method.
 
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, processAnnotation
 

Field Detail

localStrings

protected static final LocalStringManagerImpl localStrings

logger

protected java.util.logging.Logger logger

ejbProvider

protected AnnotationTypesProvider ejbProvider
Constructor Detail

AbstractHandler

public AbstractHandler()
Method Detail

getTypeDependencies

public java.lang.Class<? extends java.lang.annotation.Annotation>[] getTypeDependencies()
Specified by:
getTypeDependencies in interface AnnotationHandler
Returns:
an array of annotation types this annotation handler would require to be processed (if present) before it processes it's own annotation type.

getDefaultProcessedResult

protected HandlerProcessingResult getDefaultProcessedResult()
Returns:
a default processed result

getDefaultFailedResult

protected HandlerProcessingResult getDefaultFailedResult()
Returns:
a default failed result

getInvalidAnnotatedElementHandlerResult

protected HandlerProcessingResult getInvalidAnnotatedElementHandlerResult(AnnotatedElementHandler aeHandler,
                                                                          AnnotationInfo ainfo)
                                                                   throws AnnotationProcessorException
Parameters:
aeHandler -
ainfo -
Returns:
a result for invalid AnnotatedElementHandler
Throws:
AnnotationProcessorException

log

protected void log(java.util.logging.Level level,
                   AnnotationInfo ainfo,
                   java.lang.String localizedMessage)
            throws AnnotationProcessorException
Throws:
AnnotationProcessorException

getInjectionMethodPropertyName

protected java.lang.String getInjectionMethodPropertyName(java.lang.reflect.Method method,
                                                          AnnotationInfo ainfo)
                                                   throws AnnotationProcessorException
Throws:
AnnotationProcessorException

validateInjectionMethod

protected void validateInjectionMethod(java.lang.reflect.Method method,
                                       AnnotationInfo ainfo)
                                throws AnnotationProcessorException
Check if given method is a valid injection method. Throw Exception if it is not.

Throws:
AnnotationProcessorException

getOverallProcessingResult

protected HandlerProcessingResult getOverallProcessingResult(java.util.List<HandlerProcessingResult> resultList)

getEjbAnnotationTypes

protected java.lang.Class<? extends java.lang.annotation.Annotation>[] getEjbAnnotationTypes()
This is called by getTypeDependencies().

Returns:
an array of all ejb annotation types

getEjbAndWebAnnotationTypes

protected java.lang.Class<? extends java.lang.annotation.Annotation>[] getEjbAndWebAnnotationTypes()
This is called by getTypeDependencies().

Returns:
an array of all ejb and web types annotation

getWebAnnotationTypes

protected java.lang.Class<? extends java.lang.annotation.Annotation>[] getWebAnnotationTypes()
This is called by getTypeDependencies().

Returns:
an array of all web types annotation

getConnectorAnnotationTypes

protected java.lang.Class<? extends java.lang.annotation.Annotation>[] getConnectorAnnotationTypes()
This is called by getTypeDependencies().

Returns:
an array of all connector type annotations


Copyright © 2012 GlassFish Community. All Rights Reserved.