summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-08-05 03:01:09 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-08-05 03:01:09 +0000
commitc2281244d53f2af5209c892e6eda3f1b48af0cbf (patch)
tree4790332f7ed8b45c0df18f3da1a006806a8a31d2
parent66fe1748dc4497df03c618a91be8ac0e07c7e715 (diff)
TUSCANY-3642 Allow policy information on interfaces to apply to services and bindings, even if it is mutually exclusive with policy information on those elements.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@982458 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties1
-rw-r--r--sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java26
2 files changed, 15 insertions, 12 deletions
diff --git a/otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties
index 580b0861b1..01d050bb3c 100644
--- a/otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties
+++ b/otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties
@@ -72,6 +72,7 @@ ASM_8009=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oas
ASM_8010=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8010Component2, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite63] - Interface of composite service Service1 must be subset of the interface declared by promoted component service. Callback operation not found on target
ASM_8011=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite62] - [ASM60008,ASM60013] Interface of composite reference Reference1 must be compatible with the interface declared by promoted component reference. Callback operation not found on target
ASM_8012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8012Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite64] - [ASM60008,ASM60013] Interface of composite reference Reference1 must be compatible with the interface declared by promoted component reference.
+ASM_8014=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent2, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}Joe and {http://docs.oasis-open.org/ns/opencsa/sca/200912}confidentiality.transport are mutually exclusive
ASM_8017=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8017Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite72] - Interface of composite service Service1a must be subset of the interface declared by promoted component service. Callback interface doesn't match
ASM_8018=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestClient Service = TestInvocation
ASM_8019=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_8019, Artifact: Test_ASM_8019.composite] - The interface.wsdl interface {http://test.sca.oasisopen.org/}Service1 element can only have a remotable attribute with the value "true" as WSDL interface are assumed to be remotable by default. The value that was found is: false.
diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java
index 2a88a48c8c..9c4da518d7 100644
--- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java
+++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java
@@ -105,10 +105,7 @@ public class CompositePolicyBuilderImpl extends ComponentPolicyBuilderImpl imple
}
for (Endpoint ep : componentService.getEndpoints()) {
- if (componentService.getInterfaceContract() != null) {
- // Inherit from the component.service.interface
- inherit(ep, null, true, componentService.getInterfaceContract().getInterface());
- }
+
// Inherit from binding
inherit(ep, null, true, ep.getBinding());
@@ -116,7 +113,12 @@ public class CompositePolicyBuilderImpl extends ComponentPolicyBuilderImpl imple
// Inherit from composite/component/service
inherit(ep, null, true, ep.getService(), ep.getComponent(), composite );
-
+ if (componentService.getInterfaceContract() != null) {
+ // Inherit from the component.service.interface
+ // Do not check mutual exclusion here.. interfaces do not follow normal rules
+ // of the structural hierarchy (Policy spec 4.10)
+ inherit(ep, null, false, componentService.getInterfaceContract().getInterface());
+ }
// Replace profile intents with their required intents
// Replace unqualified intents if there is a qualified intent in the list
@@ -159,19 +161,19 @@ public class CompositePolicyBuilderImpl extends ComponentPolicyBuilderImpl imple
}
for (EndpointReference epr : componentReference.getEndpointReferences()) {
-
- // Inherit from the component.reference.interface
- if (componentReference.getInterfaceContract() != null) {
- inherit(epr, null, true, componentReference.getInterfaceContract().getInterface());
- }
-
+
// Inherit from binding
inherit(epr, null, true, epr.getBinding());
// Inherit from composite/component/reference
inherit(epr, null, true, epr.getReference(), epr.getComponent(), composite);
-
+ // Inherit from the component.reference.interface
+ if (componentReference.getInterfaceContract() != null) {
+ // Do not check mutual exclusion here.. interfaces do not follow normal rules
+ // of the structural hierarchy (Policy spec 4.10)
+ inherit(epr, null, true, componentReference.getInterfaceContract().getInterface());
+ }
// Replace profile intents with their required intents
// Replace unqualified intents if there is a qualified intent in the list