Class<?> targetJavaInterface = getTargetJavaClass(serviceInterface);
targetJavaInterface = RemoteInterfaceGenerator.generate(targetJavaInterface);
/*
* In OSGi, the classloader for the interface cannot access the classes for the CGLIB
*/
enhancer.setClassLoader(new ClassLoaderDelegate(targetJavaInterface.getClassLoader(), getClass().getClassLoader()));
enhancer.setInterfaces(new Class[] {targetJavaInterface});
return (Remote)enhancer.create();
}