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

InitMethodReturnType

public class InitMethodReturnType extends SessionBeanTest
The Init annotation is used to specify the correspondence of a method on the bean class with a createMETHOD method for an adapted EJB 2.1 EJBHome and/or EJBLocalHome client view. The result type of such an Init method is required to be void.
author
Vikas Awasthi

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

        Set<EjbInitInfo> initMethods = descriptor.getInitMethods();
        for (EjbInitInfo initInfo : initMethods) {
            Method method = initInfo.getBeanMethod().getMethod(descriptor);
            if(!method.getReturnType().getName().equals("void")) {
                addErrorDetails(result, compName);
                result.failed(smh.getLocalString
                        (getClass().getName()+".failed",
                        "Wrong init method [ {0} ].",
                        new Object[] {method}));
            }
        }
        
        if(result.getStatus() != Result.FAILED) {
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString
                    (getClass().getName()+".passed",
                    "Valid init method(s)."));
        }
        return result;