/** * Utility function to create a textual node ID for a given node. * * @param node * The node to create the ID for * @return The created ID */ protected static String createNodeId(final DependencyGraphNode<?> node) { return AbstractDependencyGraphFormatter.createNodeId(node.getId()); }
/** * Creates a new filter using the given parameters. * * @param configuration * The configuration to use. * @param projectContext * The project context to use. */ public ComponentDependencyGraphAssemblyFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext, new ComponentAssemblyDependencyGraph(AssemblyRepository.ROOT_ASSEMBLY_COMPONENT)); }
/** * Creates a new filter using the given parameters. * * @param configuration * The configuration to use. * @param projectContext * The project context to use. */ public ContainerDependencyGraphFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext, new ContainerDependencyGraph(ExecutionEnvironmentRepository.ROOT_EXECUTION_CONTAINER)); }
@Override protected String formatDependencyGraph(final OperationAllocationDependencyGraph graph, final boolean includeWeights, final boolean useShortLabels, final boolean plotLoops) { final StringBuilder builder = new StringBuilder(); this.appendGraphHeader(builder); final ElementGrouping grouping = this.groupElements(graph); this.createGraph(grouping, builder, useShortLabels); graph.traverseWithVerticesFirst(new EdgeVisitor(builder, includeWeights, plotLoops, useShortLabels)); this.appendGraphFooter(builder); return builder.toString(); }
@Override protected String formatDependencyGraph(final OperationAssemblyDependencyGraph graph, final boolean includeWeights, final boolean useShortLabels, final boolean plotLoops) { final StringBuilder builder = new StringBuilder(); this.appendGraphHeader(builder); final ConcurrentMap<AssemblyComponent, List<DependencyGraphNode<AssemblyComponentOperationPair>>> grouping = this.groupNodesByComponent(graph); this.createGraph(builder, grouping, useShortLabels); graph.traverseWithVerticesFirst(new EdgeVisitor(builder, includeWeights, plotLoops, useShortLabels)); this.appendGraphFooter(builder); return builder.toString(); }
@Override protected String formatDependencyGraph(final ComponentAllocationDependencyGraph graph, final boolean includeWeights, final boolean useShortLabels, final boolean plotLoops) { final StringBuilder builder = new StringBuilder(); this.appendGraphHeader(builder); // Group nodes by execution containers final ConcurrentMap<ExecutionContainer, List<DependencyGraphNode<AllocationComponent>>> nodeMap = ComponentAllocationDependencyGraphFormatter .groupNodesByComponent(graph); for (final Entry<ExecutionContainer, List<DependencyGraphNode<AllocationComponent>>> entry : nodeMap.entrySet()) { this.handleContainerEntry(entry, builder, useShortLabels); } // Format the graph's edges graph.traverseWithVerticesFirst(new EdgeFormattingVisitor(builder, includeWeights, plotLoops, useShortLabels)); this.appendGraphFooter(builder); return builder.toString(); }
@Override protected String formatDependencyGraph(final ComponentAssemblyDependencyGraph graph, final boolean includeWeights, final boolean useShortLabels, final boolean plotLoops) { final StringBuilder builder = new StringBuilder(); this.appendGraphHeader(builder); graph.traverseWithVerticesFirst(new FormatterVisitor(builder, includeWeights, plotLoops, useShortLabels)); this.appendGraphFooter(builder); return builder.toString(); }
@Override protected String formatDependencyGraph(final ContainerDependencyGraph graph, final boolean includeWeights, final boolean useShortLabels, final boolean plotLoops) { final StringBuilder builder = new StringBuilder(); this.appendGraphHeader(builder); graph.traverseWithVerticesFirst(new FormatterVisitor(builder, includeWeights, plotLoops, useShortLabels)); this.appendGraphFooter(builder); return builder.toString(); }
@Override public void processMessage(final AbstractMessage message, final DependencyGraphNode<?> sourceNode, final DependencyGraphNode<?> targetNode, final TimeUnit timeunit) { // Ignore internal executions if (sourceNode.equals(targetNode)) { return; } ResponseTimeDecoration timeDecoration = targetNode.getDecoration(ResponseTimeDecoration.class); if (timeDecoration == null) { timeDecoration = new ResponseTimeDecoration(timeunit, this.displayTimeunit); targetNode.addDecoration(timeDecoration); } timeDecoration.registerExecution(message.getReceivingExecution()); }
/** * Utility function to determine the fill color to use for a given node. * * @param node * The node to determine the color for * @return The color name to use for the given node */ protected static String getNodeFillColor(final DependencyGraphNode<?> node) { if (node.isAssumed()) { return DotFactory.DOT_FILLCOLOR_GRAY; } else { return DotFactory.DOT_FILLCOLOR_WHITE; } }
/** * Creates a new filter using the given configuration. * * @param configuration * The configuration to use. * @param projectContext * The project context to use. */ public ComponentDependencyGraphAllocationFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext, new ComponentAllocationDependencyGraph(AllocationRepository.ROOT_ALLOCATION_COMPONENT)); }
@Override protected String formatGraph(final G graph, final boolean includeWeights, final boolean useShortLabels, final boolean plotLoops) { return this.formatDependencyGraph(graph, includeWeights, useShortLabels, plotLoops); }
/** * Adds an outgoing dependency to this node. The dependency will be marked as not assumed. * * @param destination * The destination of the dependency. * @param origin * The origin of the destination. * @param originPolicy * The origin policy of the destination. */ public void addOutgoingDependency(final DependencyGraphNode<T> destination, final TraceInformation origin, final IOriginRetentionPolicy originPolicy) { this.addOutgoingDependency(destination, false, origin, originPolicy); }
/** * Adds an incoming dependency to this node. The dependency will be marked as not assumed. * * @param source * The source of the dependency. * @param origin * The origin of the destination. * @param originPolicy * The origin policy of the destination. */ public void addIncomingDependency(final DependencyGraphNode<T> source, final TraceInformation origin, final IOriginRetentionPolicy originPolicy) { this.addIncomingDependency(source, false, origin, originPolicy); }
public final T getEntity() { return this.getPayload(); }
/** * This is a helper method to invoke all decorators and send them a message. * * @param message * The message to send the decorators. * @param sourceNode * The source node. * @param targetNode * The target node. */ protected void invokeDecorators(final AbstractMessage message, final DependencyGraphNode<?> sourceNode, final DependencyGraphNode<?> targetNode) { for (final AbstractNodeDecorator currentDecorator : this.decorators) { currentDecorator.processMessage(message, sourceNode, targetNode, super.recordsTimeUnitFromProjectContext); } }
/** * Utility function to create a textual node ID for an operation. * * @param operation * The operation to create the ID for * @return The created ID */ protected static String createOperationNodeId(final Operation operation) { return AbstractDependencyGraphFormatter.createNodeId(operation.getId()); }
/** * Creates a new filter using the given parameters. * * @param configuration * The configuration to use. * @param projectContext * The project context to use. */ public OperationDependencyGraphAllocationFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext, new OperationAllocationDependencyGraph(new AllocationComponentOperationPair( AbstractSystemSubRepository.ROOT_ELEMENT_ID, OperationRepository.ROOT_OPERATION, AllocationRepository.ROOT_ALLOCATION_COMPONENT))); }
/** * Creates a new filter using the given parameters. * * @param configuration * The configuration to use. * @param projectContext * The project context to use. */ public OperationDependencyGraphAssemblyFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext, new OperationAssemblyDependencyGraph(new AssemblyComponentOperationPair(AbstractSystemSubRepository.ROOT_ELEMENT_ID, OperationRepository.ROOT_OPERATION, AssemblyRepository.ROOT_ASSEMBLY_COMPONENT))); }
/** * Determines whether the given edge is assumed or not. * * @param source * The source of the edge. * @param target * The target of the edge. * * @return true iff the edge is assumed (which means in fact that either the source or the target or both are assumed). */ protected boolean isDependencyAssumed(final DependencyGraphNode<?> source, final DependencyGraphNode<?> target) { return source.isAssumed() || target.isAssumed(); } }