summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox')
-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();