FileDocCategorySizeDatePackage
ASEjbBeanPool.javaAPI DocGlassfish v2 API6775Fri May 04 22:34:06 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.runtime.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.deployment.runtime.BeanPoolDescriptor
beanPool
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)

        Result result = getInitializedResult();
    	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        
        IASEjbExtraDescriptors ejbJar = descriptor.getIASEjbExtraDescriptors();
        if(ejbJar!=null)
        {
            try
            {
                beanPool = ejbJar.getBeanPool();
                if(beanPool!=null)
                {
                    if(descriptor instanceof EjbSessionDescriptor && ((EjbSessionDescriptor)descriptor).getSessionType().equals(EjbSessionDescriptor.STATEFUL))
                    {
                        result.addWarningDetails(smh.getLocalString
                                      ("tests.componentNameConstructor",
                                       "For [ {0} ]",
                                       new Object[] {compName.toString()}));
                        result.warning(smh.getLocalString(getClass().getName()+".warning",
                            "WARNING [AS-EJB ejb] : bean-pool should be defined for Stateless Session Beans, Entity Beans or Message Driven Beans"));
                    }else if(descriptor instanceof EjbMessageBeanDescriptor || (descriptor instanceof EjbSessionDescriptor && ((EjbSessionDescriptor)descriptor).getSessionType().equals(EjbSessionDescriptor.STATELESS)) || descriptor instanceof EjbEntityDescriptor){
                        result.addGoodDetails(smh.getLocalString
                                      ("tests.componentNameConstructor",
                                       "For [ {0} ]",
                                       new Object[] {compName.toString()}));
                        result.passed(smh.getLocalString(getClass().getName()+".passed",
                            "PASSED [AS-EJB ejb] : bean-pool is correctly defined"));                
                    
                    }
                }
                else
                {
                    result.addNaDetails(smh.getLocalString
                                  ("tests.componentNameConstructor",
                                   "For [ {0} ]",
                                   new Object[] {compName.toString()}));
                    result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
                        "NOT APPLICABLE [AS-EJB ejb] : bean-pool element not defined"));
                }
                    return result;
            }catch(Exception ex)
            {
                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 a beanPool object"));
            }
        }
        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 IASEjbExtraDescriptor object"));
        }
        return result;