FileDocCategorySizeDatePackage
ASEjbJMSDurableSubscriptionName.javaAPI DocGlassfish v2 API5586Fri May 04 22:35:12 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.ias

ASEjbJMSDurableSubscriptionName

public class ASEjbJMSDurableSubscriptionName extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
ejb [0,n] jms-durable-subscription-name ? [String] The jms-durable-subscription-name is the name of a durable subscription associated with a message-driven bean. The name should not be a null string. The value is required if destination-type is Topic and subscription-durability is durable
author
Irfan Ahmed

Fields Summary
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();
        boolean oneFailed = false;
        
        if(ejbJar!=null)
        {
            Ejb testCase = super.getEjb(descriptor.getName(),ejbJar);
            String jmsDurableName = testCase.getJmsDurableSubscriptionName();
            if(jmsDurableName != null)
            {
                if(jmsDurableName.length()==0)
                {
                    result.failed(smh.getLocalString(getClass().getName()+".failed",
                        "FAILED [AS-EJB ejb] : jms-durable-subscription-name cannot be an empty string value"));
                }
                else
                {
                    result.passed(smh.getLocalString(getClass().getName()+".passed",
                        "PASSED [AS-EJB ejb] : jms-durable-subscription-name is {0}", new Object[]{jmsDurableName}));
                }
            }
            else
            {
                if(descriptor instanceof EjbMessageBeanDescriptor)
                {
                    EjbMessageBeanDescriptor msgBeanDesc = (EjbMessageBeanDescriptor)descriptor;
                    if(msgBeanDesc.hasTopicDest() && msgBeanDesc.hasDurableSubscription())
                    {
                        result.failed(smh.getLocalString(getClass().getName()+".failed",
                            "FAILED [AS-EJB ejb] : jms-durable-subscription-name should be defined for an MDB with"+
                            " destination type Topic and Durable subscription type"));
                    }
                    else
                    {
                        result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
                            "NOT APPLICABLE [AS-EJB ejb] : jms-durable-subscription-name element is not defined"));
                    }
                }
                else
                {
                    result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
                        "NOT APPLICABLE [AS-EJB ejb] : jms-durable-subscription-name element is not defined"));
                }
            }
        }
        else
        {
            result.addErrorDetails(smh.getLocalString
                 (getClass().getName() + ".notRun",
                  "NOT RUN [AS-EJB] : Could not create an SunEjbJar object"));
        }
        return result;