@Override public String getIdentifier() { return this.getEntity().getIdentifier(); }
private static ConcurrentMap<ExecutionContainer, List<DependencyGraphNode<AllocationComponent>>> groupNodesByComponent( final ComponentAllocationDependencyGraph graph) { final ConcurrentMap<ExecutionContainer, List<DependencyGraphNode<AllocationComponent>>> nodeMap = new ConcurrentHashMap<>(); for (final DependencyGraphNode<AllocationComponent> node : graph.getNodes()) { final ExecutionContainer container = node.getEntity().getExecutionContainer(); List<DependencyGraphNode<AllocationComponent>> nodes = nodeMap.get(container); if (nodes == null) { nodes = new ArrayList<>(); nodeMap.put(container, nodes); } nodes.add(node); } return nodeMap; }
private ConcurrentMap<AssemblyComponent, List<DependencyGraphNode<AssemblyComponentOperationPair>>> groupNodesByComponent( final OperationAssemblyDependencyGraph graph) { final ConcurrentMap<AssemblyComponent, List<DependencyGraphNode<AssemblyComponentOperationPair>>> grouping = new ConcurrentHashMap<>(); for (final DependencyGraphNode<AssemblyComponentOperationPair> vertex : graph.getVertices()) { final AssemblyComponentOperationPair pair = vertex.getEntity(); final AssemblyComponent assemblyComponent = pair.getAssemblyComponent(); List<DependencyGraphNode<AssemblyComponentOperationPair>> nodes = grouping.get(assemblyComponent); if (nodes == null) { nodes = new ArrayList<>(); grouping.put(assemblyComponent, nodes); } nodes.add(vertex); } return grouping; }
private ElementGrouping groupElements(final OperationAllocationDependencyGraph graph) { final ConcurrentMap<ExecutionContainer, Set<AllocationComponent>> allocationComponentGrouping = new ConcurrentHashMap<>(); final ConcurrentMap<AllocationComponent, Set<DependencyGraphNode<AllocationComponentOperationPair>>> operationGrouping = new ConcurrentHashMap<>(); for (final DependencyGraphNode<AllocationComponentOperationPair> vertex : graph.getVertices()) { final AllocationComponent allocationComponent = vertex.getEntity().getAllocationComponent(); final ExecutionContainer executionContainer = allocationComponent.getExecutionContainer(); // Update map execution container -> allocation components Set<AllocationComponent> allocationComponents = allocationComponentGrouping.get(executionContainer); if (allocationComponents == null) { allocationComponents = new HashSet<>(); allocationComponentGrouping.put(executionContainer, allocationComponents); } allocationComponents.add(allocationComponent); // Update map allocation component -> operations Set<DependencyGraphNode<AllocationComponentOperationPair>> operations = operationGrouping.get(allocationComponent); if (operations == null) { operations = new HashSet<>(); operationGrouping.put(allocationComponent, operations); } operations.add(vertex); } return new ElementGrouping(allocationComponentGrouping, operationGrouping); }
/** * Utility function to create a label for component nodes. * * @param node * The component node to create the label for * @param useShortLabels * Indicates whether short labels (i.e. without package names) should be used * @param stereotype * The stereotype to use in the label * @return A formatted component node label */ protected static String createComponentNodeLabel(final DependencyGraphNode<AllocationComponent> node, final boolean useShortLabels, final String stereotype) { final StringBuilder builder = new StringBuilder(); final AllocationComponent component = node.getEntity(); builder.append(stereotype).append("\\n") .append(component.getAssemblyComponent().getName()).append(':'); if (useShortLabels) { builder.append(".."); } else { builder.append(component.getAssemblyComponent().getType().getPackageName()).append('.'); } builder.append(component.getAssemblyComponent().getType().getTypeName()); AbstractGraphFormatter.formatDecorations(builder, node); return builder.toString(); } }
@Override public void visitVertex(final DependencyGraphNode<ExecutionContainer> vertex) { final ExecutionContainer container = vertex.getEntity();
@Override public void visitVertex(final DependencyGraphNode<AssemblyComponent> vertex) { final AssemblyComponent component = vertex.getEntity();
final Operation operation = node.getEntity().getOperation();
final Operation operation = node.getEntity().getOperation();
final AllocationComponent allocationComponent1 = nodeMap.get(EXPECTED_ALLOCATION_COMPONENT_NAME_1).getEntity(); final AllocationComponent allocationComponent2 = nodeMap.get(EXPECTED_ALLOCATION_COMPONENT_NAME_2).getEntity(); Assert.assertNotNull(allocationComponent1); Assert.assertNotNull(allocationComponent2);
senderPair = this.getGraph().getRootNode().getEntity(); } else { senderPair = pairFactory.getPairInstanceByPair(senderComponent, senderOperation); receiverPair = this.getGraph().getRootNode().getEntity(); } else { receiverPair = pairFactory.getPairInstanceByPair(receiverComponent, receiverOperation);
senderPair = this.getGraph().getRootNode().getEntity(); } else { senderPair = pairFactory.getPairInstanceByPair(senderComponent, senderOperation); receiverPair = this.getGraph().getRootNode().getEntity(); } else { receiverPair = pairFactory.getPairInstanceByPair(receiverComponent, receiverOperation);