summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2012-07-26 18:33:33 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2012-07-26 18:33:33 +0000
commit72a503ad27ee1cff61943650d6a62a28e98e1b1d (patch)
treebfdeffa1a8558ec35f4d38116d8406d154c34c78 /sca-java-2.x/trunk/modules
parent94fe4f9f4c1c02bd655e0be72c5ee9c9cb22941c (diff)
Keep the composite object into the RemoteEndpoints
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1366136 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r--sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpoints.java12
-rw-r--r--sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpointsProcessor.java13
2 files changed, 19 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpoints.java b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpoints.java
index b4e631c08e..c1020a49af 100644
--- a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpoints.java
+++ b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpoints.java
@@ -20,10 +20,20 @@
package org.apache.tuscany.sca.node.configuration.xml;
import java.util.ArrayList;
-import java.util.List;
+import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.assembly.Endpoint;
public class RemoteEndpoints extends ArrayList<Endpoint> {
private static final long serialVersionUID = -9045949145596529956L;
+
+ private Composite composite;
+
+ public Composite getComposite() {
+ return composite;
+ }
+
+ public void setComposite(Composite composite) {
+ this.composite = composite;
+ }
}
diff --git a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpointsProcessor.java b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpointsProcessor.java
index dc4b79e099..640b84119b 100644
--- a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpointsProcessor.java
+++ b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/RemoteEndpointsProcessor.java
@@ -47,8 +47,8 @@ import org.apache.tuscany.sca.policy.PolicySet;
* A StaX processor for remote endpoints
*/
public class RemoteEndpointsProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<RemoteEndpoints> {
- private final static String ENDPOINT = "remoteEndpoints";
- private final static QName ENDPOINT_QNAME = new QName(Constants.SCA11_TUSCANY_NS, ENDPOINT);
+ private final static String REMOTE_ENDPOINTS = "remoteEndpoints";
+ private final static QName REMOTE_ENDPOINTS_QNAME = new QName(Constants.SCA11_TUSCANY_NS, REMOTE_ENDPOINTS);
private ExtensionPointRegistry registry;
@@ -71,7 +71,7 @@ public class RemoteEndpointsProcessor extends BaseAssemblyProcessor implements S
}
public QName getArtifactType() {
- return ENDPOINT_QNAME;
+ return REMOTE_ENDPOINTS_QNAME;
}
public RemoteEndpoints read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException,
@@ -80,13 +80,14 @@ public class RemoteEndpointsProcessor extends BaseAssemblyProcessor implements S
if (reader.getEventType() == XMLStreamConstants.START_DOCUMENT) {
reader.nextTag();
}
- if (reader.getEventType() == XMLStreamConstants.START_ELEMENT && ENDPOINT_QNAME.equals(reader.getName())) {
+ if (reader.getEventType() == XMLStreamConstants.START_ELEMENT && REMOTE_ENDPOINTS_QNAME.equals(reader.getName())) {
// Skip the "endpoint" element wrapper
reader.nextTag();
}
Object model = extensionProcessor.read(reader, context);
if (model instanceof Composite) {
Composite composite = (Composite)model;
+ endpoints.setComposite(composite);
for (Component component : composite.getComponents()) {
if (component.getURI() == null) {
// Default to the component name as the uri
@@ -113,7 +114,9 @@ public class RemoteEndpointsProcessor extends BaseAssemblyProcessor implements S
public void write(RemoteEndpoints model, XMLStreamWriter writer, ProcessorContext context)
throws ContributionWriteException, XMLStreamException {
-
+ writeStart(writer, REMOTE_ENDPOINTS_QNAME.getNamespaceURI(), REMOTE_ENDPOINTS_QNAME.getLocalPart());
+ extensionProcessor.write(model.getComposite(), writer, context);
+ writeEnd(writer);
}
public Class<RemoteEndpoints> getModelType() {