AllocationComponent allocInst = systemModelRepository.getAllocationFactory() .lookupAllocationComponentInstanceByNamedIdentifier(allocationComponentName); if (allocInst == null) { // Allocation component instance doesn't exist AssemblyComponent assemblyComponent = systemModelRepository.getAssemblyFactory() .lookupAssemblyComponentInstanceByNamedIdentifier(assemblyComponentTypeName); if (assemblyComponent == null) { // assembly instance doesn't exist ComponentType componentType = systemModelRepository.getTypeRepositoryFactory().lookupComponentTypeByNamedIdentifier(assemblyComponentTypeName); if (componentType == null) { // NOPMD NOCS (NestedIf) componentType = systemModelRepository.getTypeRepositoryFactory().createAndRegisterComponentType(assemblyComponentTypeName, assemblyComponentTypeName); assemblyComponent = systemModelRepository.getAssemblyFactory() .createAndRegisterAssemblyComponentInstance(assemblyComponentTypeName, componentType); ExecutionContainer execContainer = systemModelRepository.getExecutionEnvironmentFactory() .lookupExecutionContainerByNamedIdentifier(executionContainerName); if (execContainer == null) { // doesn't exist, yet execContainer = systemModelRepository.getExecutionEnvironmentFactory() .createAndRegisterExecutionContainer(executionContainerName, executionContainerName); allocInst = systemModelRepository.getAllocationFactory() .createAndRegisterAllocationComponentInstance(allocationComponentName, assemblyComponent, execContainer); Operation op = systemModelRepository.getOperationFactory().lookupOperationByNamedIdentifier(operationFactoryName); if (op == null) { // Operation doesn't exist op = systemModelRepository.getOperationFactory() .createAndRegisterOperation(operationFactoryName, allocInst.getAssemblyComponent().getType(), operationSignature); allocInst.getAssemblyComponent().getType().addOperation(op);
@Override protected AllocationComponentOperationPair concreteCreatePair(final SynchronousCallMessage callMsg) { final AllocationComponent allocationComponent = callMsg.getReceivingExecution().getAllocationComponent(); final Operation op = callMsg.getReceivingExecution().getOperation(); final AllocationComponentOperationPair destination = AggregatedAllocationComponentOperationCallTreeFilter.this.getSystemEntityFactory() .getAllocationPairFactory().getPairInstanceByPair(allocationComponent, op); // will never be null! return destination; } }
/** * {@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); } }
+ ".space{padding: 4px 10px;}\n" + "</style>"); ps.println("</head><body>"); this.htmlHSpace(ps, 10); this.printOpenSurroundingSpan(ps); this.printOpenHtmlTable(ps, "Component Types", new String[] { "ID", "Package", "Name", "Operations" }); final Collection<ComponentType> componentTypes = this.typeRepositoryFactory.getComponentTypes(); for (final ComponentType type : componentTypes) { for (final Operation op : type.getOperations()) { opListBuilder.append("<li>") .append(this.htmlEntityRef(op.getId(), SystemModelRepository.simpleHTMLEscape(op.getSignature().toString()), EntityType.OPERATION)) .append("</li>"); this.htmlEntityLabel(type.getId(), Integer.toString(type.getId()), EntityType.COMPONENT_TYPE), SystemModelRepository.simpleHTMLEscape(type.getPackageName()), SystemModelRepository.simpleHTMLEscape(type.getTypeName()), opListBuilder.toString(), }; this.printHtmlTableRow(ps, cells); this.printCloseHtmlTable(ps); this.printLinebreak(ps); this.printOpenHtmlTable(ps, "Operations", new String[] { "ID", "Component type", "Name", "Parameter types", "Return type" }); final Collection<Operation> operations = this.operationFactory.getOperations(); for (final Operation op : operations) { final StringBuilder paramListStrBuild = new StringBuilder(); for (final String paramType : op.getSignature().getParamTypeList()) { paramListStrBuild.append("<li>").append(SystemModelRepository.simpleHTMLEscape(paramType)).append("</li>"); this.htmlEntityLabel(op.getId(), Integer.toString(op.getId()), EntityType.OPERATION), this.htmlEntityRef(op.getComponentType().getId(), SystemModelRepository.simpleHTMLEscape(op.getComponentType().getFullQualifiedName()),
/** * Creates a new instance of this class. */ public TestTraceReconstructionFilter() { final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), new AnalysisController()); final ExecutionFactory executionFactory = new ExecutionFactory(systemEntityFactory); // Manually create Executions for a trace this.exec0_0__bookstore_searchBook = executionFactory.genExecution("Bookstore", "bookstore", "searchBook", TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID, 1 * (1000 * 1000), 10 * (1000 * 1000), 0, 0); this.exec1_1__catalog_getBook = executionFactory.genExecution("Catalog", "catalog", "getBook", TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID, 2 * (1000 * 1000), 4 * (1000 * 1000), 1, 1); this.exec2_1__crm_getOrders = executionFactory.genExecution("CRM", "crm", "getOrders", TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID, 5 * (1000 * 1000), 8 * (1000 * 1000), 2, 1); this.exec3_2__catalog_getBook = executionFactory.genExecution("Catalog", "catalog", "getBook", TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID, 6 * (1000 * 1000), 7 * (1000 * 1000), 3, 2); }
boolean successfulExecution = true; final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), this.analysisController);
ComponentType componentTypeA = this.systemEntityFactory.getTypeRepositoryFactory().lookupComponentTypeByNamedIdentifier(componentTypeName); if (componentTypeA == null) { componentTypeA = this.systemEntityFactory.getTypeRepositoryFactory().createAndRegisterComponentType(componentTypeName, componentTypeName); Operation operationAa = this.systemEntityFactory.getOperationFactory().lookupOperationByNamedIdentifier(operationName); if (operationAa == null) { operationAa = this.systemEntityFactory.getOperationFactory().createAndRegisterOperation( operationName, componentTypeA, new Signature(operationName, modifierList, returnType, paramTypeList)); AssemblyComponent assemblyComponentA = this.systemEntityFactory.getAssemblyFactory().lookupAssemblyComponentInstanceByNamedIdentifier(componentInstanceName); if (assemblyComponentA == null) { assemblyComponentA = this.systemEntityFactory.getAssemblyFactory().createAndRegisterAssemblyComponentInstance(componentInstanceName, componentTypeA); ExecutionContainer containerC = this.systemEntityFactory.getExecutionEnvironmentFactory().lookupExecutionContainerByNamedIdentifier(executionContainerName); if (containerC == null) { containerC = this.systemEntityFactory.getExecutionEnvironmentFactory().createAndRegisterExecutionContainer(executionContainerName, executionContainerName); this.systemEntityFactory.getAllocationFactory().lookupAllocationComponentInstanceByNamedIdentifier(allocationName); if (allocationComponentA == null) { allocationComponentA = this.systemEntityFactory.getAllocationFactory().createAndRegisterAllocationComponentInstance(allocationName, assemblyComponentA, containerC);
controller); final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), controller);
@Override public AllocationComponentOperationPair createPair(final SynchronousCallMessage callMsg) { final AllocationComponent allocationComponent = callMsg.getReceivingExecution().getAllocationComponent(); final Operation op = callMsg.getReceivingExecution().getOperation(); final AllocationComponentOperationPair destination = TraceCallTreeFilter.this.getSystemEntityFactory().getAllocationPairFactory() .getPairInstanceByPair(allocationComponent, op); // will never be null! return destination; } }, mt, TraceCallTreeFilter.this.dotOutputFn + "-" + mt.getTraceId() + ".dot", false, TraceCallTreeFilter.this.shortLabels); // no weights
final Operation receiverOperation = m.getReceivingExecution().getOperation(); final AssemblyComponentOperationPairFactory pairFactory = this.getSystemEntityFactory().getAssemblyPairFactory();
final AnalysisController controller = new AnalysisController(); final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), controller); final ExecutionFactory executionFactory = new ExecutionFactory(systemEntityFactory);
final Operation receiverOperation = m.getReceivingExecution().getOperation(); final AllocationComponentOperationPairFactory pairFactory = this.getSystemEntityFactory().getAllocationPairFactory();
final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), controller); final ExecutionFactory executionFactory = new ExecutionFactory(systemEntityFactory);
@Before public void setUp() throws Exception { final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), new AnalysisController()); this.eFactory = new ExecutionFactory(systemEntityFactory); int myNumExecutions = 0; // Manually create Executions for a trace myNumExecutions++; this.exec0_0__bookstore_searchBook = this.eFactory.genExecution("Bookstore", "bookstore", "searchBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 1, 10, 0, 0); this.minTin = this.exec0_0__bookstore_searchBook.getTin(); this.maxTout = this.exec0_0__bookstore_searchBook.getTout(); myNumExecutions++; this.exec1_1__catalog_getBook = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 2, 4, 1, 1); myNumExecutions++; this.exec2_1__crm_getOrders = this.eFactory.genExecution("CRM", "crm", "getOrders", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 5, 8, 2, 1); myNumExecutions++; this.exec3_2__catalog_getBook = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 6, 7, 3, 2); // Just some basic checks to make sure that the trace has been set up properly (we've had some trouble here) Assert.assertNotSame(this.exec3_2__catalog_getBook.getOperation(), this.exec2_1__crm_getOrders.getOperation()); Assert.assertNotSame(this.exec0_0__bookstore_searchBook.getAllocationComponent(), this.exec1_1__catalog_getBook.getAllocationComponent()); this.numExecutions = myNumExecutions; }
final SystemModelRepository systemModelRepository = new SystemModelRepository(new Configuration(), analysisController);
private static GraphTestSetup prepareEnvironment(final AnalysisController analysisController, final AbstractGraphProducingFilter<?> graphProducer, final String inputPortName, final String systemModelRepositoryPortName, final List<OperationExecutionRecord> executionRecords, final AbstractGraphFilter<?, ?, ?, ?>... graphFilters) throws AnalysisConfigurationException { final SystemModelRepository systemModelRepository = new SystemModelRepository(new Configuration(), analysisController); final ListReader<OperationExecutionRecord> readerPlugin = new ListReader<>(new Configuration(), analysisController); readerPlugin.addAllObjects(executionRecords); final ExecutionRecordTransformationFilter transformationFilter = new ExecutionRecordTransformationFilter(new Configuration(), analysisController); final TraceReconstructionFilter traceReconstructionFilter = new TraceReconstructionFilter(new Configuration(), analysisController); // Correct the behavior of the extended list filter as properties are not inherited. final Configuration graphReceiverConfiguration = new Configuration(); graphReceiverConfiguration.setProperty(ListCollectionFilter.CONFIG_PROPERTY_NAME_MAX_NUMBER_OF_ENTRIES, ListCollectionFilter.CONFIG_PROPERTY_VALUE_NUMBER_OF_ENTRIES); final GraphReceiverPlugin graphReceiver = new GraphReceiverPlugin(graphReceiverConfiguration, analysisController); // Connect repositories analysisController.connect(transformationFilter, AbstractTraceAnalysisFilter.REPOSITORY_PORT_NAME_SYSTEM_MODEL, systemModelRepository); analysisController.connect(traceReconstructionFilter, AbstractTraceAnalysisFilter.REPOSITORY_PORT_NAME_SYSTEM_MODEL, systemModelRepository); if (systemModelRepositoryPortName != null) { analysisController.connect(graphProducer, systemModelRepositoryPortName, systemModelRepository); } // Connect plugins analysisController.connect(readerPlugin, ListReader.OUTPUT_PORT_NAME, transformationFilter, ExecutionRecordTransformationFilter.INPUT_PORT_NAME_RECORDS); analysisController.connect(transformationFilter, ExecutionRecordTransformationFilter.OUTPUT_PORT_NAME_EXECUTIONS, traceReconstructionFilter, TraceReconstructionFilter.INPUT_PORT_NAME_EXECUTIONS); analysisController.connect(traceReconstructionFilter, TraceReconstructionFilter.OUTPUT_PORT_NAME_MESSAGE_TRACE, graphProducer, inputPortName); DependencyGraphTestUtil.connectGraphFilters(analysisController, graphProducer, graphFilters, graphReceiver); return new GraphTestSetup(analysisController, graphReceiver); }
private static void createAndConnectPlugins(final IAnalysisController analysisController) { final SystemModelRepository traceRepo = new SystemModelRepository(new Configuration(), analysisController);