summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.3/modules/binding-rmi/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sca-java-1.3/modules/binding-rmi/src/main')
-rw-r--r--branches/sca-java-1.3/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/branches/sca-java-1.3/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java b/branches/sca-java-1.3/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java
index 479ee7c8b2..4d5278b49c 100644
--- a/branches/sca-java-1.3/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java
+++ b/branches/sca-java-1.3/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java
@@ -97,7 +97,17 @@ public class RMIService implements ComponentLifecycle {
enhancer.setSuperclass(UnicastRemoteObject.class);
enhancer.setCallback(new MethodInterceptor() {
public Object intercept(Object arg0, Method method, Object[] args, MethodProxy arg3) throws Throwable {
- return invokeTarget(JavaInterfaceUtil.findOperation(method, serviceInterface.getOperations()), args);
+ try {
+ return invokeTarget(JavaInterfaceUtil.findOperation(method, serviceInterface.getOperations()), args);
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ for (Class<?> declaredType : method.getExceptionTypes()) {
+ if (declaredType.isInstance(cause)) {
+ throw e;
+ }
+ }
+ throw cause;
+ }
}
});
Class targetJavaInterface = getTargetJavaClass(serviceInterface);