1 23 24 package com.sun.enterprise.tools.verifier.tests.ejb.ejb30; 25 26 import com.sun.enterprise.deployment.LifecycleCallbackDescriptor; 27 28 import java.util.Set ; 29 import java.lang.reflect.Method ; 30 31 42 public class CallbackMethodArgument extends InterceptorMethodTest { 43 44 void testInterceptorMethods(Set <LifecycleCallbackDescriptor> callbackDescs, 45 String callbackMethodName, 46 Boolean isBeanMethod) { 47 if(callbackMethodName.equals("AroundInvoke")) 48 return; 50 ClassLoader cl = getVerifierContext().getClassLoader(); 51 for (LifecycleCallbackDescriptor callbackDesc : callbackDescs) { 52 try { 53 Method method = callbackDesc.getLifecycleCallbackMethodObject(cl); 54 Class <?>[] args = method.getParameterTypes(); 55 if(isBeanMethod && args.length!=0) { 56 logFailure(callbackMethodName, method); 57 } else if(!isBeanMethod && 58 (args.length!=1 || 59 !javax.interceptor.InvocationContext.class.isAssignableFrom(args[0]))) { 60 logFailure(callbackMethodName, method); 61 } 62 } catch (Exception e) {} } 64 } 65 } 66 | Popular Tags |