FileDocCategorySizeDatePackage
ASEjbBeanPool.javaAPI DocGlassfish v2 API5786Fri May 04 22:35:16 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.ias.beanpool

ASEjbBeanPool

public class ASEjbBeanPool extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
ejb [0,n] bean-pool ? steady-pool-size ? [String] pool-resize-quantity ? [String] max-pool-size ? [String] pool-idle-timeout-in-seconds ? [String] max-wait-time-in-millis ? [String] The bean-pool element specifies the bean pool properties for the beans The bean-pool is valid only for Stateless Session Beans (SSB) and Message-Driven Beans (MDB).
author
Irfan Ahmed

Fields Summary
public com.sun.enterprise.tools.common.dd.ejb.BeanPool
beanPool
public com.sun.enterprise.tools.common.dd.ejb.Ejb
testCase
Constructors Summary
Methods Summary
public Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)

        Result result = getInitializedResult();
	ComponentNameConstructor compName = new ComponentNameConstructor(descriptor);
        
        SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject();
        if(ejbJar!=null)
        {
            getBeanPool(descriptor,ejbJar);
            if(beanPool!=null)
            {
                if(descriptor instanceof EjbSessionDescriptor 
                    && ((EjbSessionDescriptor)descriptor).getSessionTypeString().equals(EjbSessionDescriptor.STATEFUL)
                    || descriptor instanceof EjbEntityDescriptor)
                {
                    result.warning(smh.getLocalString(getClass().getName()+".warning1",
                    "WARNING [AS-EJB ejb] : bean-pool should be defined for Stateless Session Beans or Message Driven Beans"));
                }
            }
            else
            {
                if(descriptor instanceof EjbMessageBeanDescriptor
                    || (descriptor instanceof EjbSessionDescriptor 
                            && ((EjbSessionDescriptor)descriptor).getSessionTypeString().equals(EjbSessionDescriptor.STATELESS)))
                {
                    result.warning(smh.getLocalString(getClass().getName()+".warning",
                        "WARNING [AS-EJB ejb] : bean-pool should be defined for Stateless Session and Message Driven Beans"));
                }
                else
                    result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
                        "NOT APPLICABLE [AS-EJB ejb] : bean-pool element not defined"));
            }
            return result;
        }
        else
        {
            result.addErrorDetails(smh.getLocalString
                                   ("tests.componentNameConstructor",
                                    "For [ {0} ]",
                                    new Object[] {compName.toString()}));
            result.addErrorDetails(smh.getLocalString
                 (getClass().getName() + ".notRun",
                  "NOT RUN [AS-EJB] : Could not create an SunEjbJar object"));
            return result;
        }
    
public voidgetBeanPool(com.sun.enterprise.deployment.EjbDescriptor descriptor, com.sun.enterprise.tools.common.dd.ejb.SunEjbJar ejbJar)

        testCase = getEjb(descriptor.getName(),ejbJar);
        beanPool = testCase.getBeanPool();