use of org.iobserve.model.correspondence.ComponentEntry in project iobserve-analysis by research-iobserve.
the class EntryEventMapperStage method execute.
@Override
protected void execute(final EntryCallEvent event) throws Exception {
/**
* retrieve mapping.
*/
// TODO correct key names?
final List<ComponentEntry> entries = this.correspondenceResource.findObjectsByTypeAndProperty(ComponentEntry.class, CorrespondencePackage.Literals.COMPONENT_ENTRY, "implementationId", event.getClassSignature());
if (!entries.isEmpty()) {
final ComponentEntry componentEntry = entries.get(0);
final OperationEntry operationEntry = this.correspondenceResource.findObjectsByTypeAndProperty(OperationEntry.class, CorrespondencePackage.Literals.OPERATION_ENTRY, "implementationId", event.getOperationSignature()).get(0);
if (operationEntry != null) {
final AllocationEntry allocationEntry = this.correspondenceResource.findObjectsByTypeAndProperty(AllocationEntry.class, CorrespondencePackage.Literals.ALLOCATION_ENTRY, "implementationId", event.getHostname()).get(0);
if (allocationEntry != null) {
this.computePcmEntryCallEvent(componentEntry, operationEntry, allocationEntry, event);
} else {
this.logger.debug("No corresponding allocation for entry call {}", event.toString());
}
} else {
this.logger.debug("No corresponding component for entry call {}", event.toString());
}
} else {
this.logger.debug("No corresponding component for entry call {}", event.toString());
}
}
use of org.iobserve.model.correspondence.ComponentEntry in project iobserve-analysis by research-iobserve.
the class ProbeMapper method computeAllocationComponentJavaSignature.
private String computeAllocationComponentJavaSignature(final AllocationContext allocation, final OperationSignature operationSignature) throws ControlEventCreationFailedException, InvocationException, DBException {
// there are only interfaces on model level -> therefore only public methods (no
// getModifiers available)
final String modifier = "public";
final DataType returnType = operationSignature.getReturnType__OperationSignature();
final List<DataTypeEntry> dataTypeEntries = this.correspondenceResource.collectAllObjectsByType(DataTypeEntry.class, CorrespondencePackage.Literals.DATA_TYPE_ENTRY);
final String codeLevelReturnType = this.getCodeLevelDataType(dataTypeEntries, returnType);
final String methodSignature = operationSignature.getEntityName();
// TODO parameters
final String parameterString = "*";
final AssemblyContext assemblyContext = this.assemblyResource.resolve(allocation.getAssemblyContext_AllocationContext());
final RepositoryComponent repositoryComponent = this.repositoryResource.resolve(assemblyContext.getEncapsulatedComponent__AssemblyContext());
final List<ComponentEntry> componentEntries = this.correspondenceResource.collectAllObjectsByType(ComponentEntry.class, CorrespondencePackage.Literals.COMPONENT_ENTRY);
final String codeLevelComponentIdentifier = this.getCodeLevelComponent(componentEntries, repositoryComponent);
final String completeMethodSignature = modifier + " " + codeLevelReturnType + " " + codeLevelComponentIdentifier + "." + methodSignature + "(" + parameterString + ")";
this.logger.debug("Constructed method string: {}", completeMethodSignature);
return completeMethodSignature;
}
Aggregations