Home Interface follows the standard rules for RMI-IIOP remote interfaces
test.
All enterprise beans home interface's must follow the standard rules
for RMI-IIOP remote interfaces.
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
if(descriptor.getHomeClassName() == null || "".equals(descriptor.getHomeClassName())) {
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.localinterfaceonly.notapp",
"Not Applicable because, EJB [ {0} ] has Local Interfaces only.",
new Object[] {descriptor.getEjbClassName()}));
return result;
}
if ((descriptor instanceof EjbSessionDescriptor) ||
(descriptor instanceof EjbEntityDescriptor)) {
try {
ClassLoader jcl = getVerifierContext().getClassLoader();
Class c = Class.forName(descriptor.getHomeClassName(), false, jcl);
// remote interface must be defined as valid Rmi-IIOP remote interface
boolean isValidRmiIIOPInterface = false;
if (RmiIIOPUtils.isValidRmiIIOPInterface(c) && RmiIIOPUtils.isValidRmiIIOPInterfaceMethods(c)) {
isValidRmiIIOPInterface = true;
}
// remote interface must be defined as valid Rmi-IIOP remote interface
if (!isValidRmiIIOPInterface){
addErrorDetails(result, compName);
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"Error: [ {0} ] is not defined as valid RMI-IIOP remote interface. All enterprise beans home interfaces must be defined as valid RMI-IIOP remote interface. [ {1} ] is not a valid remote home interface.",
new Object[] {descriptor.getHomeClassName(),descriptor.getHomeClassName()}));
} else {
addGoodDetails(result, compName);
result.passed(smh.getLocalString
(getClass().getName() + ".passed",
"[ {0} ] properly declares the home interface as valid RMI-IIOP remote interface.",
new Object[] {descriptor.getHomeClassName()}));
}
} catch (ClassNotFoundException e) {
Verifier.debug(e);
addErrorDetails(result, compName);
result.failed(smh.getLocalString
(getClass().getName() + ".failedException",
"Error: [ {0} ] class not found.",
new Object[] {descriptor.getHomeClassName()}));
}
return result;
} else {
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"[ {0} ] expected {1} bean or {2} bean, but called with {3}.",
new Object[] {getClass(),"Session","Entity",descriptor.getName()}));
return result;
}