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

CallbackMethodArgument

public class CallbackMethodArgument extends InterceptorMethodTest
Lifecycle callback interceptor methods defined on an interceptor class have the following signature: void (InvocationContext) Lifecycle callback interceptor methods defined on a bean class have the following signature: void ()
author
Vikas Awasthi

Fields Summary
Constructors Summary
Methods Summary
voidtestInterceptorMethods(java.util.Set callbackDescs, java.lang.String callbackMethodName, java.lang.Boolean isBeanMethod)

        if(callbackMethodName.equals("AroundInvoke"))
            return; // this test applies only to lifecycle callback methods

        ClassLoader cl = getVerifierContext().getClassLoader();
        for (LifecycleCallbackDescriptor callbackDesc : callbackDescs) {
            try {
                Method method = callbackDesc.getLifecycleCallbackMethodObject(cl);
                Class<?>[] args = method.getParameterTypes();
                if(isBeanMethod && args.length!=0) {
                    logFailure(callbackMethodName, method);
                } else if(!isBeanMethod && 
                        (args.length!=1 || 
                                !javax.interceptor.InvocationContext.class.isAssignableFrom(args[0]))) {
                    logFailure(callbackMethodName, method);
                }
            } catch (Exception e) {}//ignore as it will be caught in other tests
        }