FileDocCategorySizeDatePackage
SEIExtendsRemoteCheck.javaAPI DocGlassfish v2 API5159Fri May 04 22:34:16 BST 2007com.sun.enterprise.tools.verifier.tests.webservices

SEIExtendsRemoteCheck

public class SEIExtendsRemoteCheck extends WSTest implements WSCheck

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(WebServiceEndpoint descriptor)

param
descriptor the WebService deployment descriptor
return
Result the results for this assertion

        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        // get hold of the SEI Class
        String s = descriptor.getServiceEndpointInterface();
        if (s == null) {
            // internal error, should never happen
            result.failed(smh.getLocalString
                    ("com.sun.enterprise.tools.verifier.tests.webservices.Error",
                            "Error: Unexpected error occurred [ {0} ]",
                            new Object[] {"SEI Class Name Null"}));
            return result;

        }
        Class sei = null;
        try {
            sei = Class.forName(s, false, getVerifierContext().getClassLoader());
        } catch(ClassNotFoundException e) {
            addErrorDetails(result, compName);
            result.failed(smh.getLocalString
                    ("com.sun.enterprise.tools.verifier.tests.webservices.Error",
                            "Error: Unexpected error occurred [ {0} ]",
                            new Object[] {e.toString()}));

            return result;
        }
        if (!(getVerifierContext().getSchemaVersion().compareTo("1.1") > 0)) {
            if(!java.rmi.Remote.class.isAssignableFrom(sei)) {
                result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
                        "For [ {0} ]", new Object[] {compName.toString()}));
                result.failed(smh.getLocalString(getClass().getName() + ".failed",
                        "SEI [{0}] does not extend the java.rmi.Remote interface.",
                        new Object[] {s}));
            }
        } else if (java.rmi.Remote.class.isAssignableFrom(sei)) {
            result.addWarningDetails(smh.getLocalString ("tests.componentNameConstructor",
                    "For [ {0} ]", new Object[] {compName.toString()}));
            result.warning(smh.getLocalString(getClass().getName() + ".warning",
                    "SEI [{0}] is not required to extend the java.rmi.Remote interface.",
                    new Object[] {s}));
        }
        if(result.getStatus() != Result.FAILED
                && result.getStatus() != Result.WARNING) {
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString(getClass().getName() + ".passed",
                    "Service Enpoint is defined properly"));
        }
        return result;