From c122a7379b57d45d2c994728171d20609842f7c5 Mon Sep 17 00:00:00 2001 From: rfeng Date: Wed, 12 Aug 2009 23:43:27 +0000 Subject: Fix issues around XMLStreamWriter based on the isRepairingNamespaces property of XMLOutputFactory More refactoring to use common-xml and common-java git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@803742 13f79535-47bb-0310-9956-ffa450edef68 --- .../rmi/provider/RMIServiceBindingProvider.java | 25 ++-------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'java/sca/modules/binding-rmi-runtime/src') diff --git a/java/sca/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java b/java/sca/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java index 506c2385fb..c572b4e19b 100644 --- a/java/sca/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java +++ b/java/sca/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java @@ -34,6 +34,7 @@ import net.sf.cglib.proxy.MethodProxy; import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.binding.rmi.RMIBinding; +import org.apache.tuscany.sca.common.java.classloader.ClassLoaderDelegate; import org.apache.tuscany.sca.host.rmi.RMIHost; import org.apache.tuscany.sca.host.rmi.RMIHostException; import org.apache.tuscany.sca.interfacedef.Interface; @@ -140,33 +141,11 @@ public class RMIServiceBindingProvider implements ServiceBindingProvider { /* * In OSGi, the classloader for the interface cannot access the classes for the CGLIB */ - enhancer.setClassLoader(new MixedClassLoader(targetJavaInterface.getClassLoader(), getClass().getClassLoader())); + enhancer.setClassLoader(new ClassLoaderDelegate(targetJavaInterface.getClassLoader(), getClass().getClassLoader())); enhancer.setInterfaces(new Class[] {targetJavaInterface}); return (Remote)enhancer.create(); } - private static class MixedClassLoader extends ClassLoader { - private ClassLoader runtime; - - public MixedClassLoader(ClassLoader parent, ClassLoader runtime) { - super(parent); - this.runtime = runtime; - } - - @Override - protected Class findClass(String name) throws ClassNotFoundException { - try { - return super.findClass(name); - } catch (ClassNotFoundException e) { - if (runtime != null && runtime != getParent()) { - return runtime.loadClass(name); - } else { - throw e; - } - } - } - } - private Object invokeTarget(Operation op, Object[] args) throws InvocationTargetException { return wire.invoke(op, args); } -- cgit v1.2.3