@Override public String getIdentifier() { return this.getAssemblyComponent().getName(); } }
private static String createAllocationComponentNodeLabel(final AllocationComponent component, final boolean useShortLabels) { final StringBuilder builder = new StringBuilder(); builder.append(AbstractDependencyGraphFormatter.STEREOTYPE_ALLOCATION_COMPONENT).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()); return builder.toString(); }
private static String allocationComponentLabel(final AllocationComponent component, final boolean shortLabels) { 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(assemblyComponentName).append(':'); if (!shortLabels) { strBuild.append(componentTypePackagePrefx).append('.'); } else { strBuild.append(".."); } strBuild.append(componentTypeIdentifier); return strBuild.toString(); }
/** * 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(); } }
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(); }
/** * {@inheritDoc} */ @Override protected AssemblyComponentOperationPair concreteCreatePair(final SynchronousCallMessage callMsg) { final Execution execution = callMsg.getReceivingExecution(); final AssemblyComponent assemblyComponent = execution.getAllocationComponent().getAssemblyComponent(); final Operation op = execution.getOperation(); return this.getSystemEntityFactory().getAssemblyPairFactory().getPairInstanceByPair(assemblyComponent, op); } }
final AssemblyComponent senderComponent = me.getSendingExecution().getAllocationComponent().getAssemblyComponent(); final AssemblyComponent receiverComponent = me.getReceivingExecution().getAllocationComponent().getAssemblyComponent(); if (!plottedComponentIds.contains(senderComponent.getId())) { ps.print("object(O" + senderComponent.getId() + ",\"\",\"" + SequenceDiagramFilter.assemblyComponentLabel(senderComponent, shortLabels) + "\");" receiverDotId = "O" + receiverComponent.getId(); } else if (sdMode == SDModes.ASSEMBLY) { final AssemblyComponent senderComponent = me.getSendingExecution().getAllocationComponent().getAssemblyComponent(); final AssemblyComponent receiverComponent = me.getReceivingExecution().getAllocationComponent().getAssemblyComponent(); senderDotId = "O" + senderComponent.getId(); receiverDotId = "O" + receiverComponent.getId();
if (op == null) { // Operation doesn't exist op = systemModelRepository.getOperationFactory() .createAndRegisterOperation(operationFactoryName, allocInst.getAssemblyComponent().getType(), operationSignature); allocInst.getAssemblyComponent().getType().addOperation(op);
/** * Checks whether the given executions are equal or not. * * @param r1 * The first execution object. * @param r2 * The second execution object. * * @return true if and only if the executions have the same values. */ private boolean executionsEqual(final Execution r1, final Execution r2) { if (r1 == r2) { // NOPMD (no equals) return true; } if ((r1 == null) || (r2 == null)) { return false; } return (r1.getAllocationComponent().getAssemblyComponent().getId() == r2.getAllocationComponent().getAssemblyComponent().getId()) && (r1.getOperation().getId() == r2.getOperation().getId()) && (r1.getEoi() == r2.getEoi()) && (r1.getEss() == r2.getEss()); }
/** * Creates a new instance of this class using the given parameters. * * @param t * The execution trace to be stored in this container. */ public ExecutionTraceHashContainerAssemblyEquivalence(final ExecutionTrace t) { super(t); final int prime = 31; int result = 1; for (final Execution r : t.getTraceAsSortedExecutionSet()) { result = (prime * result) + r.getOperation().getId(); result = (prime * result) + r.getAllocationComponent().getAssemblyComponent().getId(); result = (prime * result) + r.getEoi(); result = (prime * result) + r.getEss(); } // this.hashCodeBuffer = result; }
this.htmlEntityLabel(allocationComponent.getId(), Integer.toString(allocationComponent.getId()), EntityType.ALLOCATION_COMPONENT), this.htmlEntityRef(allocationComponent.getAssemblyComponent().getId(), SystemModelRepository.simpleHTMLEscape(allocationComponent.getAssemblyComponent().toString()), EntityType.ALLOCATION_COMPONENT), this.htmlEntityRef(allocationComponent.getExecutionContainer().getId(),
final ComponentType type1 = allocationComponent1.getAssemblyComponent().getType(); final ComponentType type2 = allocationComponent2.getAssemblyComponent().getType();
continue; final AssemblyComponent senderComponent = m.getSendingExecution().getAllocationComponent().getAssemblyComponent(); final AssemblyComponent receiverComponent = m.getReceivingExecution().getAllocationComponent().getAssemblyComponent(); DependencyGraphNode<AssemblyComponent> senderNode = this.getGraph().getNode(senderComponent.getId()); DependencyGraphNode<AssemblyComponent> receiverNode = this.getGraph().getNode(receiverComponent.getId());
continue; final AssemblyComponent senderComponent = m.getSendingExecution().getAllocationComponent().getAssemblyComponent(); final AssemblyComponent receiverComponent = m.getReceivingExecution().getAllocationComponent().getAssemblyComponent(); final int rootOperationId = OperationRepository.ROOT_OPERATION.getId(); final Operation senderOperation = m.getSendingExecution().getOperation();
ClassOperationSignaturePair.splitOperationSignatureStr(opExec.getOperationSignature()); Assert.assertEquals("Class/Component type names differ", opExecClassOperationSignature.getFqClassname(), exec.getAllocationComponent().getAssemblyComponent().getType().getFullQualifiedName()); Assert.assertEquals("Signatures differ", opExecClassOperationSignature.getSignature(), exec.getOperation().getSignature());