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 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); }
private static final String allocationComponentOperationPairNodeLabel( final AbstractCallTreeNode<AllocationComponentOperationPair> node, final boolean shortLabels) { final AllocationComponentOperationPair p = node.getEntity(); final AllocationComponent component = p.getAllocationComponent(); final Operation operation = p.getOperation(); final String resourceContainerName = component.getExecutionContainer().getName(); final String assemblyComponentName = component.getAssemblyComponent().getName(); final String componentTypePackagePrefx = component.getAssemblyComponent().getType().getPackageName(); final String componentTypeIdentifier = component.getAssemblyComponent().getType().getTypeName(); final StringBuilder strBuild = new StringBuilder(resourceContainerName).append("::\\n") .append(assemblyComponentName).append(":"); if (!shortLabels) { strBuild.append(componentTypePackagePrefx).append('.'); } else { strBuild.append(".."); } strBuild.append(componentTypeIdentifier).append("\\n."); final Signature sig = operation.getSignature(); final StringBuilder opLabel = new StringBuilder(sig.getName()); opLabel.append('('); final String[] paramList = sig.getParamTypeList(); if (paramList.length > 0) { opLabel.append(".."); } opLabel.append(')'); strBuild.append(opLabel.toString()); return strBuild.toString(); }
final AllocationComponent receiverComponent = me.getReceivingExecution().getAllocationComponent(); if (!plottedComponentIds.contains(senderComponent.getId())) { ps.print("object(O" + senderComponent.getId() + ",\"" + senderComponent.getExecutionContainer().getName() + "::\",\"" + SequenceDiagramFilter.allocationComponentLabel(senderComponent, shortLabels) + "\");" + "\n"); plottedComponentIds.add(senderComponent.getId()); ps.print("object(O" + receiverComponent.getId() + ",\"" + receiverComponent.getExecutionContainer().getName() + "::\",\"" + SequenceDiagramFilter.allocationComponentLabel(receiverComponent, shortLabels) + "\");" + "\n"); plottedComponentIds.add(receiverComponent.getId());
SystemModelRepository.simpleHTMLEscape(allocationComponent.getAssemblyComponent().toString()), EntityType.ALLOCATION_COMPONENT), this.htmlEntityRef(allocationComponent.getExecutionContainer().getId(), SystemModelRepository.simpleHTMLEscape(allocationComponent.getExecutionContainer().getName()), EntityType.EXECUTION_CONTAINER), }; this.printHtmlTableRow(ps, cells);
final ExecutionContainer senderContainer = senderComponent.getExecutionContainer(); final ExecutionContainer receiverContainer = receiverComponent.getExecutionContainer(); DependencyGraphNode<ExecutionContainer> senderNode = this.getGraph().getNode(senderContainer.getId()); DependencyGraphNode<ExecutionContainer> receiverNode = this.getGraph().getNode(receiverContainer.getId());
Assert.assertEquals("eoi's differ", opExec.getEoi(), exec.getEoi()); Assert.assertEquals("ess's differ", opExec.getEss(), exec.getEss()); Assert.assertEquals("Hostnames differ", opExec.getHostname(), exec.getAllocationComponent().getExecutionContainer().getName()); Assert.assertEquals("Session ID's differ", opExec.getSessionId(), exec.getSessionId()); Assert.assertEquals("Trace ID's differ", opExec.getTraceId(), exec.getTraceId());