summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
index a246393803..bf74482a1e 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
@@ -256,6 +256,8 @@ public class ComponentContextImpl implements RuntimeComponentContext {
ComponentService service = getSingleService(component);
try {
return createSelfReference(businessInterface, service);
+ } catch (IllegalArgumentException iae) {
+ throw iae;
} catch (Exception e) {
throw new ServiceRuntimeException(e.getMessage(), e);
}
@@ -301,6 +303,8 @@ public class ComponentContextImpl implements RuntimeComponentContext {
(RuntimeEndpointReference)createEndpointReference(component, service, null, businessInterface);
ref.setComponent(component);
return getServiceReference(businessInterface, ref);
+ } catch (IllegalArgumentException iae) {
+ throw iae;
} catch (Exception e) {
throw new ServiceRuntimeException(e);
}
@@ -465,7 +469,8 @@ public class ComponentContextImpl implements RuntimeComponentContext {
}
if(!compatible) {
- interfaceContract = null;
+ // JCA-9011
+ throw new IllegalArgumentException("Business interface " + businessInterface.getName() + " is not compatible with " + interfaceContract.getInterface().getClass().getName());
}
return interfaceContract;