FileDocCategorySizeDatePackage
InterceptorNoArgConstructor.javaAPI DocGlassfish v2 API4130Fri May 04 22:33:34 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.ejb30

InterceptorNoArgConstructor

public class InterceptorNoArgConstructor extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest
An interceptor class must have a public no-arg constructor.
author
Vikas Awasthi

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

        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        Set<EjbInterceptor> interceptors = descriptor.getInterceptorClasses();
        
        for (EjbInterceptor interceptor : interceptors) {
            try {
                Class interceptorClass = Class.forName(interceptor.getInterceptorClassName(),
                                                       false,
                                                       getVerifierContext().getClassLoader());
                try {
                    interceptorClass.getConstructor(new Class[]{});
                } catch (NoSuchMethodException e) {
                    result.getFaultLocation().setFaultyClass(interceptorClass);
                    addErrorDetails(result, compName);
                    result.failed(smh.getLocalString
                                    (getClass().getName() + ".failed",
                                    "Interceptor class [ {0} ] does not have a " +
                                    "public constructor with no arguments.",
                                    new Object[] {interceptorClass}));
                }
            } catch (ClassNotFoundException e) {}// will be caught in other tests
        }
        if(result.getStatus()!=Result.FAILED) {
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString
                            (getClass().getName() + ".passed",
                            "Valid Interceptor(s) used."));
        } 

        return result;