org.glassfish.ejb.deployment.annotation.handlers
Class AbstractEjbHandler

java.lang.Object
  extended by com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
      extended by 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 inherited from class com.sun.enterprise.deployment.annotation.handlers.AbstractHandler
ejbProvider, localStrings, logger
 
Constructor Summary
AbstractEjbHandler()
           
 
Method Summary
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().
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
getConnectorAnnotationTypes, getDefaultFailedResult, getDefaultProcessedResult, getEjbAndWebAnnotationTypes, getEjbAnnotationTypes, getInjectionMethodPropertyName, getInvalidAnnotatedElementHandlerResult, getOverallProcessingResult, getTypeDependencies, getWebAnnotationTypes, log, validateInjectionMethod
 
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
 

Constructor Detail

AbstractEjbHandler

public AbstractEjbHandler()
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
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)


Copyright © 2012 GlassFish Community. All Rights Reserved.