/** * Enterprise Bean's business(...) methods argument RMI IIOP test. Each enterprise Bean class must * define zero or more business(...) methods. The method signatures must follow these rules: * * <p>The methods return value must be legal types for RMI-IIOP. * * @param descriptor the Enterprise Java Bean deployment descriptor * @return <code>Result</code> the results for this assertion */ public Result check(EjbDescriptor descriptor) { result = getInitializedResult(); compName = getVerifierContext().getComponentNameConstructor(); if ((descriptor instanceof EjbSessionDescriptor) || (descriptor instanceof EjbEntityDescriptor)) { if (descriptor.getRemoteClassName() != null && !"".equals(descriptor.getRemoteClassName())) commonToBothInterfaces(descriptor.getRemoteClassName(), descriptor); Set<String> remoteInterfaces = descriptor.getRemoteBusinessClassNames(); for (String remoteIntf : remoteInterfaces) commonToBothInterfaces(remoteIntf, descriptor); } if (result.getStatus() != Result.FAILED) { addGoodDetails(result, compName); result.passed( smh.getLocalString( getClass().getName() + ".passed", "Proper declaration of business method(s) found.")); } return result; }
public Result check(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; }