FileDocCategorySizeDatePackage
ASEjbBeanCache.javaAPI DocGlassfish v2 API6451Fri May 04 22:35:16 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.ias.beancache

ASEjbBeanCache

public class ASEjbBeanCache extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
ejb [0,n] bean-cache ? max-cache-size ? [String] is-cache-overflow-allowed ? [String] cache-idle-timout-in-seconds ? [String] removal-timeout-in-seconds ? [String] victim-selection-policy ? [String] The bean-cache element specifies the bean cache properties for the bean. This is valid only for entity beans and stateful session beans
author
Irfan Ahmed

Fields Summary
public com.sun.enterprise.tools.common.dd.ejb.BeanCache
beanCache
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)
        {
            getBeanCache(descriptor,ejbJar);
            if(beanCache!=null)
            {
                if(descriptor instanceof EjbEntityDescriptor
                    || (descriptor instanceof EjbSessionDescriptor 
                            && ((EjbSessionDescriptor)descriptor).getSessionTypeString().equals(EjbSessionDescriptor.STATEFUL)))
				{
                    result.passed(smh.getLocalString(getClass().getName()+".passed",
                        "PASSED [AS-EJB ejb] : bean-cache Element parsed"));
				}
				else
				{
                    result.warning(smh.getLocalString(getClass().getName()+".warning1",
                    "WARNING [AS-EJB ejb] : bean-cache should be defined only for Stateful Session and Entity Beans"));
				}
			/*
                if(descriptor instanceof EjbSessionDescriptor 
                    && ((EjbSessionDescriptor)descriptor).getSessionTypeString().equals(EjbSessionDescriptor.STATELESS))
                {
                    result.warning(smh.getLocalString(getClass().getName()+".warning1",
                    "WARNING [AS-EJB ejb] : bean-cache should be defined for Stateful Session and Entity Beans"));
                }
                else
                    result.passed(smh.getLocalString(getClass().getName()+".passed",
                        "PASSED [AS-EJB ejb] : bean-cache Element parsed"));
			*/
            }
            else
            {
                if(descriptor instanceof EjbEntityDescriptor
                    || (descriptor instanceof EjbSessionDescriptor 
                            && ((EjbSessionDescriptor)descriptor).getSessionTypeString().equals(EjbSessionDescriptor.STATEFUL)))
                {
                    result.warning(smh.getLocalString(getClass().getName()+".warning",
                        "WARNING [AS-EJB ejb] : bean-cache should be defined for Stateful Session and Entity Beans"));
                }
                else
                    result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
                        "NOT APPLICABLE [AS-EJB ejb] : bean-cache element not defined"));
            }
        }
        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 voidgetBeanCache(com.sun.enterprise.deployment.EjbDescriptor descriptor, com.sun.enterprise.tools.common.dd.ejb.SunEjbJar ejbJar)

        testCase = getEjb(descriptor.getName(),ejbJar);
        beanCache = testCase.getBeanCache();