FileDocCategorySizeDatePackage
ClassContainsNativeMethod.javaAPI DocGlassfish v2 API3502Fri May 04 22:33:26 BST 2007com.sun.enterprise.tools.verifier.tests

ClassContainsNativeMethod

public class ClassContainsNativeMethod extends VerifierTest implements VerifierCheck
author
Sanjeeb.Sahoo@Sun.COM

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

        ComponentNameConstructor compName =
                getVerifierContext().getComponentNameConstructor();
        Result result = getInitializedResult();
        result.setStatus(Result.PASSED);
        ClosureCompilerImpl cc = ClosureCompilerImpl.class.cast(
                getVerifierContext().getClosureCompiler());
        Collection<String> nativeMethods = cc.getNativeMethods();
        if(!nativeMethods.isEmpty()) {
            addWarningDetails(result, compName);
            result.warning(smh.getLocalString(getClass().getName() + ".warning",
                    "Supplied below is the list of method names " +
                    "(in the format <package.classname>.<methodName>) " +
                    "that are defined as native methods and used by the application:\n"));
            for(String m : nativeMethods) {
                result.warning("\n\t" + m);
            }
            result.warning(smh.getLocalString(getClass().getName() + ".suggestion",
                    "Please make sure that they are implemented on all operating systems."));
        }
        return result;