FileDocCategorySizeDatePackage
RemoteInterfaceRmiIIOPException.javaAPI DocGlassfish v2 API4714Fri May 04 22:34:04 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.intf.remoteintf

RemoteInterfaceRmiIIOPException

public class RemoteInterfaceRmiIIOPException extends com.sun.enterprise.tools.verifier.tests.ejb.intf.InterfaceMethodTest
Remote interface business method throws clause must include the java.rmi.RemoteException test. Verify the following: The methods defined in this interface must follow the rules for RMI-IIOP. This means that their throws clause must include the java.rmi.RemoteException.

Fields Summary
Constructors Summary
Methods Summary
protected java.lang.StringgetInterfaceName(com.sun.enterprise.deployment.EjbDescriptor descriptor)

        return descriptor.getRemoteClassName();
    
protected java.lang.StringgetInterfaceType()

        return MethodDescriptor.EJB_REMOTE;
    
protected booleanrunIndividualMethodTest(com.sun.enterprise.deployment.EjbDescriptor descriptor, java.lang.reflect.Method method, com.sun.enterprise.tools.verifier.Result result)

run an individual verifier test against a declared method of the remote interface.

param
descriptor the deployment descriptor for the bean
param
method the method to run the test on
return
true if the test passes

        
        Class[] methodExceptionTypes = method.getExceptionTypes();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();	  
        // The methods arguments types must be legal types for
        // RMI-IIOP.  This means that their exception values must
        // throw java.rmi.RemoteException
        // methods must also throw java.rmi.RemoteException
        if (RmiIIOPUtils.isValidRmiIIOPException(methodExceptionTypes)) {
            // this is the right exception for method, throws RemoteException
            addGoodDetails(result, compName);
            result.addGoodDetails(smh.getLocalString
                    (getClass().getName() + ".passed",
                    "[ {0} ] method properly throws java.rmi.RemoteException.",
                    new Object[] {method.getName()}));
            return true;
        } else {
            addErrorDetails(result, compName);
            result.addErrorDetails(smh.getLocalString
                    (getClass().getName() + ".failed",
                    "Error: [ {0} ] method was found, but does not properly " +
                    "throw java.rmi.RemoteException.",
                    new Object[] {method.getName()}));
            return false;
        }