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

InterceptorMethodException

public class InterceptorMethodException extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest
Interceptor methods may throw runtime exceptions or application exceptions that are allowed in the throws clause of the business method. The methods of the business interface should not throw the java.rmi.RemoteException, even if the interface is a remote business interface or the bean class is annotated WebService or the method as WebMethod. These statements from the specification indicate that the interceptor method must not throw java.rmi.RemoteException
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<Method> interceptorMethods = new HashSet<Method>();

        if(descriptor.hasAroundInvokeMethod()) {
//XXX
/*
            Method method = descriptor.getAroundInvokeMethod().getMethod(descriptor);
            interceptorMethods.add(method);
*/
        }
        
        List<EjbInterceptor> interceptors = descriptor.getInterceptorChain();
        
        for (EjbInterceptor interceptor : interceptors) {
            try {
                Class interceptorClass = 
                        Class.forName(interceptor.getInterceptorClassName(),
                                      false,
                                      getVerifierContext().getClassLoader());
//XXX
/*
                Method method = interceptor.getAroundInvokeMethod().getMethod(interceptorClass);
                interceptorMethods.add(method);
*/
            } catch (ClassNotFoundException e) {
                Verifier.debug(e);
                addErrorDetails(result, compName);
                result.failed(smh.getLocalString
                                (getClass().getName() + ".failed1",
                                "[ {0} ] not found.",
                                new Object[] {interceptor.getInterceptorClassName()}));
            }
        }
        
        for (Method method : interceptorMethods) {
            Class[] exceptions = method.getExceptionTypes();
            for (Class excepClass : exceptions) {
                if(java.rmi.RemoteException.class.isAssignableFrom(excepClass)) {
                    addErrorDetails(result, compName);
                    result.failed(smh.getLocalString
                                    (getClass().getName() + ".failed",
                                    "Method [ {0} ] throws java.rmi.RemoteException.",
                                    new Object[] {method}));
                }
            }
        }
        
        if(result.getStatus()!=Result.FAILED) {
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString
                            (getClass().getName() + ".passed",
                            "Valid Interceptor methods."));
        }

        return result;