diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-09-20 20:55:39 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-09-20 20:55:39 +0000 |
commit | 792e596a1a75c5f246a4e314fba20947e18640e1 (patch) | |
tree | 2536df20c2b35c3c9d87b263baae312de5f08438 /sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany | |
parent | cca68a5ef9d90b383c37841cfcce0279a2bb4c56 (diff) |
Allows the distributed flag to be overriden
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1173364 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java index a61eb4a594..6f843ff2d6 100644 --- a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java +++ b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java @@ -60,7 +60,7 @@ public class DefaultSCABindingMapper implements SCABindingMapper { protected StAXArtifactProcessorExtensionPoint processors; protected QName defaultMappedBinding; protected QName defaultLocalBinding; - // protected boolean supportsDistributedSCA; + protected boolean alwaysDistributed; public DefaultSCABindingMapper(ExtensionPointRegistry registry, Map<String, String> attributes) { this.registry = registry; @@ -68,7 +68,9 @@ public class DefaultSCABindingMapper implements SCABindingMapper { processors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); defaultMappedBinding = getDefaultMappedBinding(attributes); defaultLocalBinding = new QName(Base.SCA11_TUSCANY_NS, "binding.local"); - // supportsDistributedSCA = isDistributed(); + if (attributes != null && "true".equalsIgnoreCase(attributes.get("alwaysDistributed"))) { + alwaysDistributed = true; + } } protected QName getDefaultMappedBinding(Map<String, String> attributes) { @@ -246,7 +248,7 @@ public class DefaultSCABindingMapper implements SCABindingMapper { */ protected QName chooseBinding(RuntimeEndpoint endpoint) { DomainRegistry domainRegistry = endpoint.getCompositeContext().getEndpointRegistry(); - boolean distributed = domainRegistry.isDistributed(); + boolean distributed = alwaysDistributed || domainRegistry.isDistributed(); InterfaceContract interfaceContract = endpoint.getService().getInterfaceContract(); if(interfaceContract != null && interfaceContract.getInterface() != null @@ -266,7 +268,7 @@ public class DefaultSCABindingMapper implements SCABindingMapper { */ protected QName chooseBinding(RuntimeEndpointReference endpointReference) { DomainRegistry domainRegistry = endpointReference.getCompositeContext().getEndpointRegistry(); - boolean distributed = domainRegistry.isDistributed(); + boolean distributed = alwaysDistributed || domainRegistry.isDistributed(); if(endpointReference.getTargetEndpoint().isRemote()) { RuntimeComponentReference ref = (RuntimeComponentReference)endpointReference.getReference(); if(ref.getInterfaceContract() != null && !ref.getInterfaceContract().getInterface().isRemotable()) { |