summaryrefslogtreecommitdiffstats
path: root/sandbox/event
diff options
context:
space:
mode:
authorrsivaram <rsivaram@13f79535-47bb-0310-9956-ffa450edef68>2008-10-21 11:57:26 +0000
committerrsivaram <rsivaram@13f79535-47bb-0310-9956-ffa450edef68>2008-10-21 11:57:26 +0000
commited12e0e4a340896a5a9dbc1da8f8b3aa05e5ff9c (patch)
tree143ad6154b4336d6870a036922a663f9bd4303c8 /sandbox/event
parent0e8b753a1be2469febb4508fbf58ede750a204c1 (diff)
Event prototype: Fix unit test failure
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@706587 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/event')
-rw-r--r--sandbox/event/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java71
1 files changed, 37 insertions, 34 deletions
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 0a4bd1939e..49ad4cbde6 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
@@ -1347,24 +1347,43 @@ public abstract class BaseConfigurationBuilderImpl {
for (Component component : composite.getComponents()) {
Implementation impl = component.getImplementation();
- for (Producer producer : impl.getProducers()) {
- Reference reference = assemblyFactory.createReference();
- reference.setName(producer.getName());
- reference.setInterfaceContract(producer.getInterfaceContract());
- if (producer.getInterfaceContract() != null && producer.getInterfaceContract().getInterface() != null)
- producer.getInterfaceContract().getInterface().setRemotable(true);
- reference.setType(producer.getType());
- reference.getApplicablePolicySets().addAll(producer.getApplicablePolicySets());
- 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);
- }
- impl.getReferences().add(reference);
- }
+ if (impl != null) {
+ for (Producer producer : impl.getProducers()) {
+ Reference reference = assemblyFactory.createReference();
+ reference.setName(producer.getName());
+ reference.setInterfaceContract(producer.getInterfaceContract());
+ if (producer.getInterfaceContract() != null && producer.getInterfaceContract().getInterface() != null)
+ producer.getInterfaceContract().getInterface().setRemotable(true);
+ reference.setType(producer.getType());
+ reference.getApplicablePolicySets().addAll(producer.getApplicablePolicySets());
+ 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);
+ }
+ impl.getReferences().add(reference);
+ }
+
+ for (Consumer consumer : impl.getConsumers()) {
+ Service service = assemblyFactory.createService();
+ service.setName(consumer.getName());
+ service.setInterfaceContract(consumer.getInterfaceContract());
+ service.setType(consumer.getType());
+ service.getApplicablePolicySets().addAll(consumer.getApplicablePolicySets());
+ 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);
+ }
+ impl.getServices().add(service);
+ }
+ }
for (Producer producer : component.getProducers()) {
ComponentReference reference = assemblyFactory.createComponentReference();
@@ -1385,22 +1404,6 @@ public abstract class BaseConfigurationBuilderImpl {
component.getReferences().add(reference);
}
- for (Consumer consumer : impl.getConsumers()) {
- Service service = assemblyFactory.createService();
- service.setName(consumer.getName());
- service.setInterfaceContract(consumer.getInterfaceContract());
- service.setType(consumer.getType());
- service.getApplicablePolicySets().addAll(consumer.getApplicablePolicySets());
- 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);
- }
- impl.getServices().add(service);
- }
for (Consumer consumer : component.getConsumers()) {
ComponentService service = assemblyFactory.createComponentService();