FileDocCategorySizeDatePackage
BusinessIntfInheritance.javaAPI DocGlassfish v2 API4462Fri May 04 22:33:34 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.ejb30

BusinessIntfInheritance

public class BusinessIntfInheritance extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest
A business interface must not extend javax.ejb.EJBObject or javax.ejb.EJBLocalObject.
author
Vikas Awasthi

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

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

        Set<String> remoteAndLocalIntfs = descriptor.getRemoteBusinessClassNames();
        remoteAndLocalIntfs.addAll(descriptor.getLocalBusinessClassNames());
        
        for (String remoteOrLocalIntf : remoteAndLocalIntfs) {
            try {
                Class c = Class.forName(remoteOrLocalIntf, 
                                        false, 
                                        getVerifierContext().getClassLoader());
                if(javax.ejb.EJBObject.class.isAssignableFrom(c) ||
                        javax.ejb.EJBLocalObject.class.isAssignableFrom(c)) {
                    addErrorDetails(result, compName);
                    result.failed(smh.getLocalString
                                    (getClass().getName() + ".failed",
                                    "[ {0} ] extends either javax.ejb.EJBObject " +
                                    "or javax.ejb.EJBLocalObject.",
                                    new Object[] {remoteOrLocalIntf}));
                }
            } catch (ClassNotFoundException e) {
                Verifier.debug(e);
                addErrorDetails(result, compName);
                result.failed(smh.getLocalString
                                (getClass().getName() + ".failed1",
                                "Business Interface class [ {0} ] not found.",
                                new Object[] {remoteOrLocalIntf}));
            }
        }
        if(result.getStatus()!=Result.FAILED) {
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString
                            (getClass().getName() + ".passed",
                            "Business Interface(s) are valid."));
        }
        
        return result;