/** * Write a list of targets into an attribute * @param reference * @return */ protected XAttr writeTargets(Reference reference) { List<String> targets = new ArrayList<String>(); for (Service target : reference.getTargets()) { targets.add(target.getName()); } return new XAttr(TARGET, targets); }
/** * Write a list of targets into an attribute * @param reference * @return */ protected XAttr writeTargets(Reference reference) { List<String> targets = new ArrayList<String>(); for (Service target : reference.getTargets()) { targets.add(target.getName()); } return new XAttr(TARGET, targets); }
/** * Helper method which obtains a list of targets for a reference * @param reference - Component reference * @return - the list of targets, which will be empty if there are no targets */ private List<ComponentService> getReferenceTargets(ComponentReference reference) { List<ComponentService> theTargets = reference.getTargets(); if (theTargets.isEmpty()) { // Component reference list of targets is empty, try the implementation reference if (reference.getReference() != null) { theTargets = reference.getReference().getTargets(); } // end if } // end if return theTargets; } // end method getReferenceTargets
/** * Helper method which obtains a list of targets for a reference * @param reference - Component reference * @return - the list of targets, which will be empty if there are no targets */ private List<ComponentService> getReferenceTargets(ComponentReference reference) { List<ComponentService> theTargets = reference.getTargets(); if (theTargets.isEmpty()) { // Component reference list of targets is empty, try the implementation reference if (reference.getReference() != null) { theTargets = reference.getReference().getTargets(); } // end if } // end if return theTargets; } // end method getReferenceTargets
/** * 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); } } }
/** * Helper method which obtains a list of targets for a reference * @param reference - Component reference * @return - the list of targets, which will be empty if there are no targets */ private List<ComponentService> getReferenceTargets(ComponentReference reference) { List<ComponentService> theTargets = reference.getTargets(); if (theTargets.isEmpty()) { // Component reference list of targets is empty, try the implementation reference if (reference.getReference() != null) { theTargets = reference.getReference().getTargets(); } // end if } // end if return theTargets; } // end method getReferenceTargets
/** * Helper method which obtains a list of targets for a reference * @param reference - Component reference * @return - the list of targets, which will be empty if there are no targets */ private List<ComponentService> getReferenceTargets(ComponentReference reference) { List<ComponentService> theTargets = reference.getTargets(); if (theTargets.isEmpty()) { // Component reference list of targets is empty, try the implementation reference if (reference.getReference() != null) { theTargets = reference.getReference().getTargets(); } // end if } // end if return theTargets; } // end method getReferenceTargets
private void reconcileReferenceMultiplicity(ComponentType componentType, Reference compositeReference, Reference promotedComponentReference, Monitor monitor) { if (compositeReference.getMultiplicity() != null) { if (!isValidMultiplicityOverride(promotedComponentReference.getTargets().size() > 0, promotedComponentReference.getMultiplicity(), compositeReference.getMultiplicity())) { Monitor.error(monitor, this, Messages.ASSEMBLY_VALIDATION, "CompositeReferenceIncompatibleMultiplicity", componentType.getURI(), compositeReference.getName(), promotedComponentReference.getName()); } } else { compositeReference.setMultiplicity(promotedComponentReference.getMultiplicity()); } }
private void reconcileReferenceMultiplicity(ComponentType componentType, Reference compositeReference, Reference promotedComponentReference, Monitor monitor) { if (compositeReference.getMultiplicity() != null) { if (!isValidMultiplicityOverride(promotedComponentReference.getTargets().size() > 0, promotedComponentReference.getMultiplicity(), compositeReference.getMultiplicity())) { Monitor.error(monitor, this, Messages.ASSEMBLY_VALIDATION, "CompositeReferenceIncompatibleMultiplicity", componentType.getURI(), compositeReference.getName(), promotedComponentReference.getName()); } } else { compositeReference.setMultiplicity(promotedComponentReference.getMultiplicity()); } }