summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java33
-rw-r--r--sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java1
2 files changed, 34 insertions, 0 deletions
diff --git a/sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
index 93199e7d6f..be57b6cb9d 100644
--- a/sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
+++ b/sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
@@ -313,6 +313,14 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt
contract = componentConsumer;
componentConsumer.setName(getString(reader, NAME));
+ // Read the EventTypes attribute
+ String eventTypes = reader.getAttributeValue(null, Constants.EVENTTYPES);
+ if (eventTypes != null) {
+ for (StringTokenizer tokens = new StringTokenizer(eventTypes); tokens.hasMoreTokens();) {
+ componentConsumer.getEventTypes().addEventType(tokens.nextToken());
+ } // end for
+ } // end if
+
//handle extension attributes
this.readExtendedAttributes(reader, name, componentConsumer, extensionAttributeProcessor);
@@ -325,6 +333,14 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt
compositeConsumer = assemblyFactory.createCompositeConsumer();
contract = componentConsumer;
compositeConsumer.setName(getString(reader, NAME));
+
+ // Read the EventTypes attribute
+ String eventTypes = reader.getAttributeValue(null, Constants.EVENTTYPES);
+ if (eventTypes != null) {
+ for (StringTokenizer tokens = new StringTokenizer(eventTypes); tokens.hasMoreTokens();) {
+ compositeConsumer.getEventTypes().addEventType(tokens.nextToken());
+ } // end for
+ } // end if
String promoted = getString(reader, PROMOTE);
if (promoted != null) {
@@ -364,6 +380,14 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt
contract = componentProducer;
componentProducer.setName(getString(reader, NAME));
+ // Read the EventTypes attribute
+ String eventTypes = reader.getAttributeValue(null, Constants.EVENTTYPES);
+ if (eventTypes != null) {
+ for (StringTokenizer tokens = new StringTokenizer(eventTypes); tokens.hasMoreTokens();) {
+ componentProducer.getEventTypes().addEventType(tokens.nextToken());
+ } // end for
+ } // end if
+
//handle extension attributes
this.readExtendedAttributes(reader, name, componentProducer, extensionAttributeProcessor);
@@ -375,6 +399,15 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt
compositeProducer = assemblyFactory.createCompositeProducer();
contract = componentProducer;
compositeProducer.setName(getString(reader, NAME));
+
+ // Read the EventTypes attribute
+ String eventTypes = reader.getAttributeValue(null, Constants.EVENTTYPES);
+ if (eventTypes != null) {
+ for (StringTokenizer tokens = new StringTokenizer(eventTypes); tokens.hasMoreTokens();) {
+ compositeProducer.getEventTypes().addEventType(tokens.nextToken());
+ } // end for
+ } // end if
+
String promoted = getString(reader, PROMOTE);
if (promoted != null) {
String promotedComponentName;
diff --git a/sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java b/sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java
index 8f29f4efa4..89e2946129 100644
--- a/sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java
+++ b/sandbox/event/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java
@@ -88,6 +88,7 @@ public interface Constants {
String PROMOTE = "promote";
String TARGET = "target";
String WIRED_BY_IMPL = "wiredByImpl";
+ String EVENTTYPES = "eventTypes";
String MULTIPLICITY = "multiplicity";
String TYPE = "type";
String ELEMENT = "element";