ServiceContract serviceContract = entryPoint.getConfiguredService().getPort().getServiceContract();
if (serviceContract != null)
service.setServiceContract(serviceContract);
componentType.getServices().add(service);
ConfiguredReference configuredReference = entryPoint.getConfiguredReference();
ServiceURI sourceURI = factory.createServiceURI(null, entryPoint, configuredReference);
for (String target : configuredReference.getTargets()) {
ServiceURI targetURI = factory.createServiceURI(null, target);
Wire wire = factory.createWire();
wire.setSource(sourceURI);
wire.setTarget(targetURI);
getWires().add(wire);
}
}
for (ExternalService externalService : getExternalServices()) {
if (externalService.getOverrideOption() == null || externalService.getOverrideOption() == OverrideOption.NO)
continue;
Reference reference = factory.createReference();
reference.setName(externalService.getName());
ServiceContract serviceContract = externalService.getConfiguredService().getPort().getServiceContract();
if (serviceContract != null)
reference.setServiceContract(serviceContract);
componentType.getReferences().add(reference);
}
for (Component<Implementation> component : getComponents()) {
for (ConfiguredProperty configuredProperty : component.getConfiguredProperties()) {
if (configuredProperty.getOverrideOption() == null || configuredProperty.getOverrideOption() == OverrideOption.NO)
continue;
componentType.getProperties().add(configuredProperty.getProperty());
}
for (ConfiguredReference configuredReference : component.getConfiguredReferences()) {
// Create a wire
ServiceURI sourceURI = factory.createServiceURI(null, component, configuredReference);
for (String target : configuredReference.getTargets()) {
ServiceURI targetURI = factory.createServiceURI(null, target);
Wire wire = factory.createWire();
wire.setSource(sourceURI);
wire.setTarget(targetURI);
getWires().add(wire);