FileDocCategorySizeDatePackage
EjbContext.javaAPI DocGlassfish v2 API6566Fri May 04 22:31:32 BST 2007com.sun.enterprise.deployment.annotation.context

EjbContext

public class EjbContext extends ResourceContainerContextImpl
author
dochez

Fields Summary
private com.sun.enterprise.deployment.WebServiceEndpoint
endpoint
private Method[]
methods
private boolean
inherited
private ArrayList
postProcessInfos
Constructors Summary
public EjbContext(com.sun.enterprise.deployment.EjbDescriptor currentEjb, Class ejbClass)


         
        super(currentEjb);
        componentClassName = currentEjb.getEjbClassName();
        ComponentDefinition cdef = new ComponentDefinition(ejbClass);
        methods = cdef.getMethods();
        Class superClass = ejbClass.getSuperclass();
        inherited = (superClass != null && !Object.class.equals(superClass));
    
Methods Summary
public voidaddPostProcessInfo(com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo, com.sun.enterprise.deployment.annotation.handlers.PostProcessor postProcessor)

        PostProcessInfo ppInfo = new PostProcessInfo();
        ppInfo.ainfo = ainfo;
        ppInfo.postProcessor = postProcessor;
        postProcessInfos.add(ppInfo);
    
public voidendElement(java.lang.annotation.ElementType type, java.lang.reflect.AnnotatedElement element)

        
        if (ElementType.TYPE.equals(type)) {
            for (PostProcessInfo ppInfo : postProcessInfos) {
                 ppInfo.postProcessor.postProcessAnnotation(
                         ppInfo.ainfo, this);
            }

            // done with processing this class, let's pop this context
            getProcessingContext().popHandler();
        }
    
public java.lang.ClassgetDeclaringClass(com.sun.enterprise.deployment.MethodDescriptor md)

        Method method = md.getMethod(getDescriptor());
        Class declaringClass = null;
        for (Method m : methods) {
            if (TypeUtil.sameMethodSignature(m, method)) {
                declaringClass = m.getDeclaringClass();
            }
        }
        return declaringClass;
    
public com.sun.enterprise.deployment.EjbDescriptorgetDescriptor()

        return (EjbDescriptor)descriptor;
    
public com.sun.enterprise.deployment.WebServiceEndpointgetEndpoint()

        return endpoint;
    
public com.sun.enterprise.deployment.types.HandlerChainContainer[]getHandlerChainContainers(boolean serviceSideHandlerChain, java.lang.Class declaringClass)

        if(serviceSideHandlerChain) {
            EjbDescriptor[] ejbs = getDescriptor().getEjbBundleDescriptor().getEjbByClassName(declaringClass.getName());
            List<WebServiceEndpoint> result = new ArrayList<WebServiceEndpoint>();
            for (EjbDescriptor ejb : ejbs) {
                result.addAll(getDescriptor().getEjbBundleDescriptor().getWebServices().getEndpointsImplementedBy(ejb));
            }
            return(result.toArray(new HandlerChainContainer[0]));
        } else {
            List<ServiceReferenceDescriptor> result = new ArrayList<ServiceReferenceDescriptor>();
            result.addAll(getDescriptor().getEjbBundleDescriptor().getServiceReferenceDescriptors());
            return(result.toArray(new HandlerChainContainer[0]));
        }
    
public com.sun.enterprise.deployment.types.ServiceReferenceContainer[]getServiceRefContainers(java.lang.String implName)

        return getDescriptor().getEjbBundleDescriptor().getEjbByClassName(implName);
    
public booleanisInherited()

        return inherited;
    
public voidsetDescriptor(com.sun.enterprise.deployment.EjbDescriptor currentEjb)

        descriptor = currentEjb;
    
public voidsetEndpoint(com.sun.enterprise.deployment.WebServiceEndpoint endpoint)

        this.endpoint = endpoint;