summaryrefslogtreecommitdiffstats
path: root/sandbox/event/modules/assembly
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/event/modules/assembly')
-rw-r--r--sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EventBindingFactory.java9
-rw-r--r--sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java37
2 files changed, 30 insertions, 16 deletions
diff --git a/sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EventBindingFactory.java b/sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EventBindingFactory.java
index f82fb02b1d..e115790c29 100644
--- a/sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EventBindingFactory.java
+++ b/sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EventBindingFactory.java
@@ -32,5 +32,14 @@ public interface EventBindingFactory {
* @return a new Event binding
*/
EventBinding createEventBinding();
+
+ /**
+ * Create a new Event binding with the provided base binding. If the base binding specified
+ * is an event binding, return that event binding.
+ *
+ * @param baseBinding The base binding for this event binding
+ * @return a new Event binding
+ */
+ EventBinding createEventBinding(Binding baseBinding);
}
diff --git a/sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java b/sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java
index 57c674d623..e87805a10b 100644
--- a/sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java
+++ b/sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java
@@ -1372,11 +1372,12 @@ public abstract class BaseConfigurationBuilderImpl {
reference.getPolicySets().addAll(producer.getPolicySets());
reference.getRequiredIntents().addAll(producer.getRequiredIntents());
for (Binding binding : producer.getBindings()) {
- EventBinding eventBinding = eventBindingFactory.createEventBinding();
- eventBinding.setBaseBinding(binding);
- reference.getBindings().add(binding);// FIXME: remove
- //reference.getBindings().add(eventBinding);
+ reference.getBindings().add(eventBindingFactory.createEventBinding(binding));
}
+ // TODO: Uncomment the following code to make Event binding the default binding for producers and consumers
+ // if (producer.getBindings().size() == 0) {
+ // reference.getBindings().add(eventBindingFactory.createEventBinding());
+ // }
impl.getReferences().add(reference);
}
@@ -1391,11 +1392,12 @@ public abstract class BaseConfigurationBuilderImpl {
service.getPolicySets().addAll(consumer.getPolicySets());
service.getRequiredIntents().addAll(consumer.getRequiredIntents());
for (Binding binding : consumer.getBindings()) {
- EventBinding eventBinding = eventBindingFactory.createEventBinding();
- eventBinding.setBaseBinding(binding);
- service.getBindings().add(binding);// FIXME: remove
- //service.getBindings().add(eventBinding);
+ service.getBindings().add(eventBindingFactory.createEventBinding(binding));
}
+ // TODO: Uncomment the following code to make Event binding the default binding for producers and consumers
+ // if (consumer.getBindings().size() == 0) {
+ // service.getBindings().add(eventBindingFactory.createEventBinding());
+ // }
impl.getServices().add(service);
}
}
@@ -1423,11 +1425,13 @@ public abstract class BaseConfigurationBuilderImpl {
reference.getPolicySets().addAll(producer.getPolicySets());
reference.getRequiredIntents().addAll(producer.getRequiredIntents());
for (Binding binding : producer.getBindings()) {
- EventBinding eventBinding = eventBindingFactory.createEventBinding();
- eventBinding.setBaseBinding(binding);
- reference.getBindings().add(binding);// FIXME: remove
- //reference.getBindings().add(eventBinding);
+ reference.getBindings().add(eventBindingFactory.createEventBinding(binding));
}
+
+ // TODO: Uncomment the following code to make Event binding the default binding for producers and consumers
+ // if (producer.getBindings().size() == 0) {
+ // reference.getBindings().add(eventBindingFactory.createEventBinding());
+ // }
component.getReferences().add(reference);
}
@@ -1443,11 +1447,12 @@ public abstract class BaseConfigurationBuilderImpl {
service.getPolicySets().addAll(consumer.getPolicySets());
service.getRequiredIntents().addAll(consumer.getRequiredIntents());
for (Binding binding : consumer.getBindings()) {
- EventBinding eventBinding = eventBindingFactory.createEventBinding();
- eventBinding.setBaseBinding(binding);
- service.getBindings().add(binding); // FIXME: remove
- //service.getBindings().add(eventBinding);
+ service.getBindings().add(eventBindingFactory.createEventBinding(binding));
}
+ // TODO: Uncomment the following code to make Event binding the default binding for producers and consumers
+ // if (consumer.getBindings().size() == 0) {
+ // service.getBindings().add(eventBindingFactory.createEventBinding());
+ // }
component.getServices().add(service);
}
}