/** * Read list of reference targets * @param reference * @param reader */ protected void readTargets(Reference reference, XMLStreamReader reader) { String value = getString(reader, TARGET); ComponentService target = null; if (value != null) { for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { target = assemblyFactory.createComponentService(); target.setUnresolved(true); target.setName(tokens.nextToken()); reference.getTargets().add(target); } } }
/** * Read list of reference targets * @param reference * @param reader */ protected void readTargets(Reference reference, XMLStreamReader reader) { String value = getString(reader, TARGET); ComponentService target = null; if (value != null) { for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { target = assemblyFactory.createComponentService(); target.setUnresolved(true); target.setName(tokens.nextToken()); reference.getTargets().add(target); } } }
private Composite wrap(EndpointReference endpointReference) { try { Composite composite = assemblyFactory.createComposite(); composite.setName(ENDPOINT_REFERENCE_QNAME); composite.setLocal(false); Component component = (Component)endpointReference.getComponent().clone(); composite.getComponents().add(component); component.getReferences().clear(); component.getServices().clear(); ComponentReference reference = (ComponentReference)endpointReference.getReference().clone(); component.getReferences().add(reference); reference.getBindings().clear(); Binding binding = (Binding)endpointReference.getBinding().clone(); reference.getBindings().add(binding); //reference.setInterfaceContract(endpointReference.getInterfaceContract()); if (endpointReference.getStatus() != EndpointReference.Status.RESOLVED_BINDING){ ComponentService service = assemblyFactory.createComponentService(); service.setName(endpointReference.getTargetEndpoint().getURI()); reference.getTargets().clear(); reference.getTargets().add(service); } return composite; } catch (CloneNotSupportedException e) { return null; } }
private Composite wrap(EndpointReference endpointReference) { try { Composite composite = assemblyFactory.createComposite(); composite.setName(ENDPOINT_REFERENCE_QNAME); composite.setLocal(false); Component component = (Component)endpointReference.getComponent().clone(); composite.getComponents().add(component); component.getReferences().clear(); component.getServices().clear(); ComponentReference reference = (ComponentReference)endpointReference.getReference().clone(); component.getReferences().add(reference); reference.getBindings().clear(); Binding binding = (Binding)endpointReference.getBinding().clone(); reference.getBindings().add(binding); //reference.setInterfaceContract(endpointReference.getInterfaceContract()); if (endpointReference.getStatus() != EndpointReference.Status.RESOLVED_BINDING){ ComponentService service = assemblyFactory.createComponentService(); service.setName(endpointReference.getTargetEndpoint().getURI()); reference.getTargets().clear(); reference.getTargets().add(service); } return composite; } catch (CloneNotSupportedException e) { return null; } }
private void addServicesFromComponentType(Component component, Monitor monitor) { // Create a component service for each service if (component.getImplementation() != null) { for (Service service : component.getImplementation().getServices()) { // check for duplicate service names in implementation if (service != component.getImplementation().getService(service.getName())){ Monitor.error(monitor, this, Messages.ASSEMBLY_VALIDATION, "DuplicateImplementationServiceName", component.getName(), service.getName()); } ComponentService componentService = (ComponentService)component.getService(service.getName()); // if the component doesn't have a service with the same name as the // component type service then create one if (componentService == null) { componentService = assemblyFactory.createComponentService(); componentService.setForCallback(service.isForCallback()); String name = service.getName(); componentService.setName(name); component.getServices().add(componentService); } } } }
private void addServicesFromComponentType(Component component, Monitor monitor) { // Create a component service for each service if (component.getImplementation() != null) { for (Service service : component.getImplementation().getServices()) { // check for duplicate service names in implementation if (service != component.getImplementation().getService(service.getName())){ Monitor.error(monitor, this, Messages.ASSEMBLY_VALIDATION, "DuplicateImplementationServiceName", component.getName(), service.getName()); } ComponentService componentService = (ComponentService)component.getService(service.getName()); // if the component doesn't have a service with the same name as the // component type service then create one if (componentService == null) { componentService = assemblyFactory.createComponentService(); componentService.setForCallback(service.isForCallback()); String name = service.getName(); componentService.setName(name); component.getServices().add(componentService); } } } }
ComponentService callbackService = assemblyFactory.createComponentService(); callbackService.setForCallback(true); callbackService.setName(reference.getName()); try { InterfaceContract contract = (InterfaceContract)reference.getInterfaceContract().clone();
ComponentService callbackService = assemblyFactory.createComponentService(); callbackService.setForCallback(true); callbackService.setName(reference.getName()); try { InterfaceContract contract = (InterfaceContract)reference.getInterfaceContract().clone();
service.setName(serviceName);
service.setName(serviceName); service.getEndpoints().add(endpoint); service.setForCallback(true);