diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-29 00:46:24 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-29 00:46:24 +0000 |
commit | 4f70240f137fdb1bfe4f5aeb26b664162310958e (patch) | |
tree | 97db8dc1929f31b004811f8c494ef8c798b0266e /branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java | |
parent | a25c6a2e6e776808d123c60d3551aea69d19c335 (diff) |
Merged from trunk. Fix the classloader parent.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@699931 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java')
-rw-r--r-- | branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java b/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java index a239d924bb..73efb47071 100644 --- a/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java +++ b/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java @@ -87,6 +87,7 @@ public class RMIServiceBindingProvider implements ServiceBindingProvider { } public void stop() { + rmiHost.unregisterService(binding.getServiceName(), getPort(binding.getPort())); } private int getPort(String port) { @@ -131,9 +132,9 @@ public class RMIServiceBindingProvider implements ServiceBindingProvider { }); Class targetJavaInterface = getTargetJavaClass(serviceInterface); if (!Remote.class.isAssignableFrom(targetJavaInterface)) { - RMIServiceClassLoader classloader = new RMIServiceClassLoader(getClass().getClassLoader()); + RMIServiceClassLoader classloader = new RMIServiceClassLoader(targetJavaInterface.getClassLoader()); final byte[] byteCode = generateRemoteInterface(targetJavaInterface); - targetJavaInterface = classloader.defineClass(byteCode); + targetJavaInterface = classloader.defineClass(targetJavaInterface.getName(), byteCode); enhancer.setClassLoader(classloader); } enhancer.setInterfaces(new Class[] {targetJavaInterface}); @@ -151,7 +152,7 @@ public class RMIServiceBindingProvider implements ServiceBindingProvider { * caller of this method, since it requires a ClassLoader to be created to define and load this interface. */ private byte[] generateRemoteInterface(Class serviceInterface) { - String interfazeName = serviceInterface.getCanonicalName(); + String interfazeName = serviceInterface.getName(); ClassWriter cw = new ClassWriter(false); String simpleName = serviceInterface.getSimpleName(); @@ -194,8 +195,8 @@ public class RMIServiceBindingProvider implements ServiceBindingProvider { super(parent); } - public Class defineClass(byte[] byteArray) { - return defineClass(null, byteArray, 0, byteArray.length); + public Class defineClass(String name, byte[] byteArray) { + return defineClass(name, byteArray, 0, byteArray.length); } } |