summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/assembly-xml/src
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2012-03-23 17:26:56 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2012-03-23 17:26:56 +0000
commit3d3b1538aaf57eb4dac00c808240102dc7ebebe8 (patch)
treebf7d31eb63503aaa41908afcc51dd523b6b23659 /sca-java-2.x/trunk/modules/assembly-xml/src
parent2b658cba22046ff1deee29562fe073bcabe4cdc0 (diff)
TUSCANY-4032 - serialize the "isForCallback" flag for an endpoint service so that the SCAClient can ignore callback endpoints in the remote case.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1304510 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/EndpointProcessor.java17
1 files changed, 16 insertions, 1 deletions
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 2102113ea1..6bfc775117 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
@@ -49,6 +49,8 @@ import org.apache.tuscany.sca.policy.PolicySet;
public class EndpointProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<Endpoint> {
private final static String ENDPOINT = "endpoint";
private final static QName ENDPOINT_QNAME = new QName(Constants.SCA11_TUSCANY_NS, ENDPOINT);
+ private final static String CALLBACK_ENDPOINT = "callbackEndpoint";
+ private final static QName CALLBACK_ENDPOINT_QNAME = new QName(Constants.SCA11_TUSCANY_NS, CALLBACK_ENDPOINT);
private ExtensionPointRegistry registry;
@@ -93,6 +95,12 @@ public class EndpointProcessor extends BaseAssemblyProcessor implements StAXArti
endpoint.setService(service);
endpoint.setBinding(binding);
+ // We use the name of the composite to indicate if this is a callback endpoint
+ // saves passing other extension attributes
+ if (composite.getName().equals(CALLBACK_ENDPOINT_QNAME)){
+ service.setForCallback(true);
+ }
+
// retrieve the stash of intents and policy sets from the component
endpoint.getRequiredIntents().addAll(component.getRequiredIntents());
endpoint.getPolicySets().addAll(component.getPolicySets());
@@ -109,7 +117,14 @@ public class EndpointProcessor extends BaseAssemblyProcessor implements StAXArti
private Composite wrap(Endpoint endpoint) {
try {
Composite composite = assemblyFactory.createComposite();
- composite.setName(ENDPOINT_QNAME);
+ // We use the name of the composite (which just wraps the single endpoint
+ // to indicate whether this endpoint represents a callback or not
+ if (endpoint.getService() != null &&
+ endpoint.getService().isForCallback()){
+ composite.setName(CALLBACK_ENDPOINT_QNAME);
+ } else {
+ composite.setName(ENDPOINT_QNAME);
+ }
composite.setLocal(false);
if (endpoint.getComponent() != null) {
Component component = (Component)endpoint.getComponent().clone();