FileDocCategorySizeDatePackage
ASEjbResRef.javaAPI DocGlassfish v2 API4663Fri May 04 22:34:06 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.runtime.resource

ASEjbResRef

public class ASEjbResRef extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
ejb [0,n] resource-ref [0,n] res-ref-name [String] jndi-name [String] default-resource-principal ? name [String] password [String] The resource-ref element holds the runtime bindings for a resource reference declared in the ejb-jar.xml
author
Irfan Ahmed

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)

	Result result = getInitializedResult();
	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();

        Set resRef = descriptor.getResourceReferenceDescriptors();
        boolean oneFailed = false;
        if(!(resRef.isEmpty()))
        {
            Iterator it = resRef.iterator();
            while (it.hasNext())
            {
                ResourceReferenceDescriptor resDesc = (ResourceReferenceDescriptor)it.next();
                String refName = resDesc.getName();
                
             try
                    {
                        descriptor.getResourceReferenceByName(refName);
                        addGoodDetails(result, compName);
                        result.passed(smh.getLocalString(getClass().getName()+".passed",
                            "PASSED [AS-EJB resource-ref] : res-ref-name {0} is verified with ejb-jar.xml",
                            new Object[]{refName}));
                    }
                    catch(IllegalArgumentException iaex)
                    {
                        Verifier.debug(iaex);
                        addErrorDetails(result, compName);
                        result.failed(smh.getLocalString(getClass().getName()+".failed",
                            "FAILED [AS-EJB resource-ref] : The res-ref-name {0} is not defined in ejb-jar.xml for this bean",
                            new Object[]{refName}));
                    }
             
            }
                
        }
        else
        {
            addNaDetails(result, compName);
            result.notApplicable(smh.getLocalString
                (getClass().getName() + ".notApplicable",
                    "{0} Does not define any resource-ref Elements",
                    new Object[] {descriptor.getName()}));
        }
    return result;