1 25 package org.objectweb.easybeans.tests.common.resources; 26 27 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.ITF_REMOTE; 28 29 import javax.naming.Context ; 30 import javax.naming.InitialContext ; 31 32 36 public abstract class AbstractInvocationMaker extends Thread { 37 38 45 @SuppressWarnings ("unused") 46 public void test(final int n, final Class beanClass, final Class beanInterface) throws Exception { 47 System.setProperty(Context.INITIAL_CONTEXT_FACTORY, 48 "org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory"); 49 Context initialContext = new InitialContext (); 50 51 for (int i = 0; i < n; i++) { 52 Object bean = initialContext.lookup(beanClass.getName() + "_" + beanInterface.getName() + ITF_REMOTE); 53 this.invokeMethod(n, bean); 54 } 55 } 56 57 63 public abstract <E> void invokeMethod(final int n, final E bean); 64 } 65 | Popular Tags |