Class AbstractEjbHandler
- java.lang.Object
-
- com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
-
- org.glassfish.ejb.deployment.annotation.handlers.AbstractEjbHandler
-
- All Implemented Interfaces:
AnnotationHandler
- Direct Known Subclasses:
MessageDrivenHandler
,SingletonHandler
,StatefulHandler
,StatelessHandler
public abstract class AbstractEjbHandler extends 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
Fields Modifier and Type Field Description protected static LocalStringManagerImpl
localStrings
-
Fields inherited from class com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
ejbProvider, logger
-
Fields inherited from interface org.glassfish.apf.AnnotationHandler
ANNOTATION_HANDLER_METADATA
-
-
Constructor Summary
Constructors Constructor Description AbstractEjbHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract EjbDescriptor
createEjbDescriptor(String elementName, AnnotationInfo ainfo)
Create a new EjbDescriptor for a given elementName and AnnotationInfo.protected void
doDescriptionProcessing(String description, EjbDescriptor ejbDescriptor)
protected void
doMappedNameProcessing(String mappedName, EjbDescriptor ejbDesc)
protected boolean
excludedFromImplementsClause(Class intf)
protected abstract String
getAnnotatedName(Annotation annotation)
Return the name attribute of given annotation.protected abstract boolean
isValidEjbDescriptor(EjbDescriptor ejbDesc, Annotation annotation)
HandlerProcessingResult
processAnnotation(AnnotationInfo ainfo)
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.protected HandlerProcessingResult
setBusinessAndHomeInterfaces(EjbDescriptor ejbDesc, AnnotationInfo ainfo)
MessageDriven bean does not need to invoke this API.protected abstract HandlerProcessingResult
setEjbDescriptorInfo(EjbDescriptor ejbDesc, 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 Detail
-
localStrings
protected static final LocalStringManagerImpl localStrings
-
-
Method Detail
-
getAnnotatedName
protected abstract String getAnnotatedName(Annotation annotation)
Return the name attribute of given annotation.- Parameters:
annotation
-- Returns:
- name
-
isValidEjbDescriptor
protected abstract boolean isValidEjbDescriptor(EjbDescriptor ejbDesc, Annotation annotation)
-
createEjbDescriptor
protected abstract EjbDescriptor createEjbDescriptor(String elementName, AnnotationInfo ainfo) throws AnnotationProcessorException
Create a new EjbDescriptor for a given elementName and AnnotationInfo.- Parameters:
elementName
-ainfo
-- Returns:
- a new EjbDescriptor
- Throws:
AnnotationProcessorException
-
setEjbDescriptorInfo
protected abstract HandlerProcessingResult setEjbDescriptorInfo(EjbDescriptor ejbDesc, AnnotationInfo ainfo) throws 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:
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.This is a method in interface AnnotationHandler.- Parameters:
ainfo
- the annotation information- Returns:
- Throws:
AnnotationProcessorException
-
setBusinessAndHomeInterfaces
protected HandlerProcessingResult setBusinessAndHomeInterfaces(EjbDescriptor ejbDesc, AnnotationInfo ainfo) throws AnnotationProcessorException
MessageDriven bean does not need to invoke this API.- Parameters:
ejbDesc
-ainfo
- for error handling- Returns:
- HandlerProcessingResult
- Throws:
AnnotationProcessorException
-
excludedFromImplementsClause
protected boolean excludedFromImplementsClause(Class intf)
-
doDescriptionProcessing
protected void doDescriptionProcessing(String description, EjbDescriptor ejbDescriptor)
-
doMappedNameProcessing
protected void doMappedNameProcessing(String mappedName, EjbDescriptor ejbDesc)
-
-