diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java index 9b2b1cca6c..d128897df0 100644 --- a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java +++ b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java @@ -100,17 +100,23 @@ public class EndpointProcessor extends BaseAssemblyProcessor implements StAXArti Composite composite = assemblyFactory.createComposite(); composite.setName(ENDPOINT_QNAME); composite.setLocal(false); - Component component = (Component)endpoint.getComponent().clone(); - component.setImplementation(null); - composite.getComponents().add(component); - component.getReferences().clear(); - component.getServices().clear(); - ComponentService service = (ComponentService)endpoint.getService().clone(); - component.getServices().add(service); - service.getBindings().clear(); - service.setInterfaceContract(endpoint.getComponentServiceInterfaceContract()); - Binding binding = (Binding)endpoint.getBinding().clone(); - service.getBindings().add(binding); + if (endpoint.getComponent() != null) { + Component component = (Component)endpoint.getComponent().clone(); + component.setImplementation(null); + composite.getComponents().add(component); + component.getReferences().clear(); + component.getServices().clear(); + if (endpoint.getService() != null) { + ComponentService service = (ComponentService)endpoint.getService().clone(); + component.getServices().add(service); + service.getBindings().clear(); + service.setInterfaceContract(endpoint.getComponentServiceInterfaceContract()); + if (endpoint.getBinding() != null) { + Binding binding = (Binding)endpoint.getBinding().clone(); + service.getBindings().add(binding); + } + } + } return composite; } catch (CloneNotSupportedException e) { return null; |