summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-09-17 22:54:56 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-09-17 22:54:56 +0000
commita51332bfd292f170ad9fed7fad22cbff5e5aecb6 (patch)
tree84d3b57908565cdac4f6fed55f902b66ce43bc95 /java/sca/modules
parentef768f50cd8080d1df3542ab959242795b74e476 (diff)
Fix the classloader parent
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@696507 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java
index 4d257b38c8..2215d7fa35 100644
--- a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java
+++ b/java/sca/modules/binding-rmi/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()));
}
protected 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.
*/
protected 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 super.defineClass(name, byteArray, 0, byteArray.length);
}
}