FileDocCategorySizeDatePackage
ASEjbCommitOption.javaAPI DocGlassfish v2 API4379Fri May 04 22:34:04 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.runtime

ASEjbCommitOption

public class ASEjbCommitOption extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
author

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

param
descriptor
return

	Result result = getInitializedResult();
	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        
        boolean oneFailed = false;
        try{
            IASEjbExtraDescriptors iasEjbExtraDesc = descriptor.getIASEjbExtraDescriptors();
            String commitOption = iasEjbExtraDesc.getCommitOption();
            if(commitOption!=null)
            {
                if(commitOption.length()==0){
                    addErrorDetails(result, compName);
                    result.failed(smh.getLocalString(getClass().getName()+".failed",
                        "FAILED [AS-EJB ejb] : commit-option cannot be an empty String"));
                }else{
                    if(!commitOption.equals("A") && !commitOption.equals("B") //4699329
                        && !commitOption.equals("C"))
                    {
                        addErrorDetails(result, compName);
                        result.failed(smh.getLocalString(getClass().getName()+".failed1",//4699329
                            "FAILED [AS-EJB ejb] : commit-option cannot be {0}. " +
                            "It must be one of A, B and "+
                            "C", new Object[]{commitOption}));
                    }
                }
            }else{
                addNaDetails(result, compName);
                result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
                    "NOT APPLICABLE [AS-EJB ejb] commit-option Element is not defined"));
            }
        }catch(Exception ex){
            addErrorDetails(result, compName);
            result.addErrorDetails(smh.getLocalString
                (getClass().getName() + ".notRun",
                "NOT RUN [AS-EJB] : Could not create an descriptor object"));
        }
        return result;