summaryrefslogtreecommitdiffstats
path: root/sandbox/event
diff options
context:
space:
mode:
authoredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2008-10-30 16:19:33 +0000
committeredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2008-10-30 16:19:33 +0000
commitbcf6871abfa4171330ce970ff9319ada6c25e0bf (patch)
tree539604399fd6a0916dbddba233528a93c8cd2a83 /sandbox/event
parent9a54462b736df41d8fc9347fd3fee15a1ae94b84 (diff)
Added in processing for reading EventTypes for CompositeConsumers and Composite Producers
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@709192 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/event')
-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";