summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/assembly-xml/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-06-23 21:08:11 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-06-23 21:08:11 +0000
commitc8853e2480640d1c8695f6476bf4465d485b3a52 (patch)
treedd22ce4af380a3e89439cf7d0dc875d5fd3688ee /sca-java-2.x/trunk/modules/assembly-xml/src
parent8c3433c53f146cbd455f5709047f1a1c4233544a (diff)
Use loopback for multicast testing
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@957345 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly-xml/src')
-rw-r--r--sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java5
-rw-r--r--sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java28
-rw-r--r--sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java27
3 files changed, 31 insertions, 29 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
index 1b64c9aa33..641e523d2c 100644
--- a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
+++ b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
@@ -84,9 +84,7 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.Problem;
import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -493,7 +491,8 @@ abstract class BaseAssemblyProcessor extends BaseStAXArtifactProcessor {
if (VALUE_QNAME.equals(name)) {
if (gotOneValue && !isMany) {
// TODO: TUSCANY-3231 this should be error not warning but that breaks OASIS tests
- warning(context.getMonitor(), "ASM50032: multiple value elements for single-valued property", name, name);
+ // [rfeng] We should not issue warning here as the component property many inherit @many from the componentType property
+ // warning(context.getMonitor(), "ASM50032: multiple value elements for single-valued property", name, name);
}
loadElement(reader, root);
gotOneValue = true;
diff --git a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java
index 9b2b1cca6c..d128897df0 100644
--- a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java
+++ b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java
@@ -100,17 +100,23 @@ public class EndpointProcessor extends BaseAssemblyProcessor implements StAXArti
Composite composite = assemblyFactory.createComposite();
composite.setName(ENDPOINT_QNAME);
composite.setLocal(false);
- Component component = (Component)endpoint.getComponent().clone();
- component.setImplementation(null);
- composite.getComponents().add(component);
- component.getReferences().clear();
- component.getServices().clear();
- ComponentService service = (ComponentService)endpoint.getService().clone();
- component.getServices().add(service);
- service.getBindings().clear();
- service.setInterfaceContract(endpoint.getComponentServiceInterfaceContract());
- Binding binding = (Binding)endpoint.getBinding().clone();
- service.getBindings().add(binding);
+ if (endpoint.getComponent() != null) {
+ Component component = (Component)endpoint.getComponent().clone();
+ component.setImplementation(null);
+ composite.getComponents().add(component);
+ component.getReferences().clear();
+ component.getServices().clear();
+ if (endpoint.getService() != null) {
+ ComponentService service = (ComponentService)endpoint.getService().clone();
+ component.getServices().add(service);
+ service.getBindings().clear();
+ service.setInterfaceContract(endpoint.getComponentServiceInterfaceContract());
+ if (endpoint.getBinding() != null) {
+ Binding binding = (Binding)endpoint.getBinding().clone();
+ service.getBindings().add(binding);
+ }
+ }
+ }
return composite;
} catch (CloneNotSupportedException e) {
return null;
diff --git a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
index 7c3d7925d3..880addb292 100644
--- a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
+++ b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
@@ -250,21 +250,18 @@ public class PolicySetProcessor extends BaseStAXArtifactProcessor implements StA
return policySet;
}
- private String getSCAPrefix(NamespaceContext nsContext) {
-
- Iterator iter = nsContext.getPrefixes(SCA11_NS);
- while ( iter.hasNext()) {
- String prefix = (String)iter.next();
- if ( !prefix.equals(XMLConstants.DEFAULT_NS_PREFIX))
- return prefix;
- }
-
- // We have to have some prefix here to use before the function name. Otherwise the
- // XPathFunctionResolver will never be called.
- xpathHelper.registerPrefix("sca_internal", SCA11_NS, nsContext);
-
- return "sca_internal";
- }
+ private String getSCAPrefix(NamespaceContext nsContext) {
+
+ Iterator<String> iter = nsContext.getPrefixes(SCA11_NS);
+ while (iter.hasNext()) {
+ String prefix = iter.next();
+ if (!prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
+ return prefix;
+ }
+ }
+
+ return "_sca";
+ }
public void readIntentMap(XMLStreamReader reader, PolicySet policySet, Intent mappedIntent, ProcessorContext context)
throws ContributionReadException {