Class AbstractEjbHandler
java.lang.Object
com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
org.glassfish.ejb.deployment.annotation.handlers.AbstractEjbHandler
- All Implemented Interfaces:
org.glassfish.apf.AnnotationHandler
- Direct Known Subclasses:
SingletonHandler,StatefulHandler,StatelessHandler
public abstract class AbstractEjbHandler
extends com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
This is an abstract class for EJB annotation handler.
Concrete subclass handlers need to implements the following methods:
public Class<? extends Annotation> getAnnotationType();
protected String getAnnotatedName(Annotation annotation );
protected boolean isValidEjbDescriptor(EjbDescriptor ejbDesc);
Annotation annotation);
protected EjbDescriptor createEjbDescriptor(String elementName,
AnnotationInfo ainfo) throws AnnotationProcessorException;
protected HandlerProcessingResult setEjbDescriptorInfo(
EjbDescriptor ejbDesc, AnnotationInfo ainfo)
throws AnnotationProcessorException;
- Author:
- Shing Wai Chan
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final com.sun.enterprise.util.LocalStringManagerImplFields inherited from class com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
ejbProvider, I18N, loggerFields inherited from interface org.glassfish.apf.AnnotationHandler
ANNOTATION_HANDLER_METADATA -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract EjbDescriptorcreateEjbDescriptor(String elementName, org.glassfish.apf.AnnotationInfo ainfo) Create a new EjbDescriptor for a given elementName and AnnotationInfo.protected voiddoDescriptionProcessing(String description, EjbDescriptor ejbDescriptor) protected voiddoMappedNameProcessing(String mappedName, EjbDescriptor ejbDesc) protected booleanprotected abstract StringgetAnnotatedName(Annotation annotation) Return the name attribute of given annotation.protected abstract booleanisValidEjbDescriptor(EjbDescriptor ejbDesc, Annotation annotation) check if the given EjbDescriptor matches the given Annotation.org.glassfish.apf.HandlerProcessingResultprocessAnnotation(org.glassfish.apf.AnnotationInfo ainfo) Process a particular annotation which type is the same as the one returned by @see getAnnotationType().protected org.glassfish.apf.HandlerProcessingResultsetBusinessAndHomeInterfaces(EjbDescriptor ejbDesc, org.glassfish.apf.AnnotationInfo ainfo) MessageDriven bean does not need to invoke this API.protected abstract org.glassfish.apf.HandlerProcessingResultsetEjbDescriptorInfo(EjbDescriptor ejbDesc, org.glassfish.apf.AnnotationInfo ainfo) Set Annotation information to Descriptor.Methods inherited from class com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
getAnnotationType, getConnectorAnnotationTypes, getDefaultFailedResult, getDefaultProcessedResult, getEjbAndWebAnnotationTypes, getEjbAnnotationTypes, getInjectionMethodPropertyName, getInvalidAnnotatedElementHandlerResult, getOverallProcessingResult, getTypeDependencies, getWebAnnotationTypes, log, validateInjectionMethod
-
Field Details
-
localStrings
protected static final com.sun.enterprise.util.LocalStringManagerImpl localStrings
-
-
Constructor Details
-
AbstractEjbHandler
public AbstractEjbHandler()
-
-
Method Details
-
getAnnotatedName
Return the name attribute of given annotation.- Parameters:
annotation-- Returns:
- name
-
isValidEjbDescriptor
check if the given EjbDescriptor matches the given Annotation.- Parameters:
ejbDesc-annotation-- Returns:
- boolean check for validity of EjbDescriptor
-
createEjbDescriptor
protected abstract EjbDescriptor createEjbDescriptor(String elementName, org.glassfish.apf.AnnotationInfo ainfo) throws org.glassfish.apf.AnnotationProcessorException Create a new EjbDescriptor for a given elementName and AnnotationInfo.- Parameters:
elementName-ainfo-- Returns:
- a new EjbDescriptor
- Throws:
org.glassfish.apf.AnnotationProcessorException
-
setEjbDescriptorInfo
protected abstract org.glassfish.apf.HandlerProcessingResult setEjbDescriptorInfo(EjbDescriptor ejbDesc, org.glassfish.apf.AnnotationInfo ainfo) throws org.glassfish.apf.AnnotationProcessorException Set Annotation information to Descriptor. This method will also be invoked for an existing descriptor with annotation as user may not specific a complete xml.- Parameters:
ejbDesc-ainfo-- Returns:
- HandlerProcessingResult
- Throws:
org.glassfish.apf.AnnotationProcessorException
-
processAnnotation
public org.glassfish.apf.HandlerProcessingResult processAnnotation(org.glassfish.apf.AnnotationInfo ainfo) throws org.glassfish.apf.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:
org.glassfish.apf.AnnotationProcessorException
-
setBusinessAndHomeInterfaces
protected org.glassfish.apf.HandlerProcessingResult setBusinessAndHomeInterfaces(EjbDescriptor ejbDesc, org.glassfish.apf.AnnotationInfo ainfo) throws org.glassfish.apf.AnnotationProcessorException MessageDriven bean does not need to invoke this API.- Parameters:
ejbDesc-ainfo- for error handling- Returns:
- HandlerProcessingResult
- Throws:
org.glassfish.apf.AnnotationProcessorException
-
excludedFromImplementsClause
-
doDescriptionProcessing
-
doMappedNameProcessing
-