FileDocCategorySizeDatePackage
StatelessHandler.javaAPI DocGlassfish v2 API5041Fri May 04 22:31:34 BST 2007com.sun.enterprise.deployment.annotation.handlers

StatelessHandler

public class StatelessHandler extends AbstractEjbHandler
This handler is responsible for handling the javax.ejb.Stateless
author
Shing Wai Chan

Fields Summary
Constructors Summary
public StatelessHandler()
Creates a new instance of StatelessHandler

    
Methods Summary
protected com.sun.enterprise.deployment.EjbDescriptorcreateEjbDescriptor(java.lang.String elementName, com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo)
Create a new EjbDescriptor for a given elementName and AnnotationInfo.

param
elementName
param
ainfo
return
a new EjbDescriptor


        AnnotatedElement ae = ainfo.getAnnotatedElement();
        Class ejbClass = (Class)ae;
        EjbSessionDescriptor newDescriptor = new EjbSessionDescriptor();
        newDescriptor.setName(elementName);
        newDescriptor.setEjbClassName(ejbClass.getName());
        newDescriptor.setSessionType(EjbSessionDescriptor.STATELESS);
        return newDescriptor;
    
protected java.lang.StringgetAnnotatedName(java.lang.annotation.Annotation annotation)
Return the name attribute of given annotation.

param
annotation
return
name

        Stateless slAn = (Stateless)annotation;
        return slAn.name();
    
public java.lang.ClassgetAnnotationType()

return
the annoation type this annotation handler is handling

        return Stateless.class;
    
protected booleanisValidEjbDescriptor(com.sun.enterprise.deployment.EjbDescriptor ejbDesc, java.lang.annotation.Annotation annotation)
Check if the given EjbDescriptor matches the given Annotation.

param
ejbDesc
param
annotation
return
boolean check for validity of EjbDescriptor

        return EjbSessionDescriptor.TYPE.equals(ejbDesc.getType());
    
protected com.sun.enterprise.deployment.annotation.HandlerProcessingResultsetEjbDescriptorInfo(com.sun.enterprise.deployment.EjbDescriptor ejbDesc, com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo)
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.

param
ejbDesc
param
ainfo
return
HandlerProcessingResult


        EjbSessionDescriptor ejbSessionDesc = (EjbSessionDescriptor)ejbDesc;
        ejbSessionDesc.setStateless(true);

        Stateless sless = (Stateless) ainfo.getAnnotation();

        doDescriptionProcessing(sless.description(), ejbDesc);
        doMappedNameProcessing(sless.mappedName(), ejbDesc);

        return setBusinessAndHomeInterfaces(ejbDesc, ainfo);