public static synchronized <E> E getBeanRemoteInstance(final Class beanClass, final Class<E> beanInterface) throws Exception {
System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory");
Context initialContext = new InitialContext();
E clBean = (E) initialContext.lookup(beanClass.getName() + "_" + beanInterface.getName() + ITF_REMOTE);
return clBean;
}
/**
* Gets a local instance of a bean.