Search in sources :

Example 1 with DataTypeEntry

use of org.iobserve.model.correspondence.DataTypeEntry 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;
}
Also used : DataTypeEntry(org.iobserve.model.correspondence.DataTypeEntry) ComponentEntry(org.iobserve.model.correspondence.ComponentEntry) PrimitiveDataType(org.palladiosimulator.pcm.repository.PrimitiveDataType) CompositeDataType(org.palladiosimulator.pcm.repository.CompositeDataType) DataType(org.palladiosimulator.pcm.repository.DataType) CollectionDataType(org.palladiosimulator.pcm.repository.CollectionDataType) AssemblyContext(org.palladiosimulator.pcm.core.composition.AssemblyContext) RepositoryComponent(org.palladiosimulator.pcm.repository.RepositoryComponent)

Aggregations

ComponentEntry (org.iobserve.model.correspondence.ComponentEntry)1 DataTypeEntry (org.iobserve.model.correspondence.DataTypeEntry)1 AssemblyContext (org.palladiosimulator.pcm.core.composition.AssemblyContext)1 CollectionDataType (org.palladiosimulator.pcm.repository.CollectionDataType)1 CompositeDataType (org.palladiosimulator.pcm.repository.CompositeDataType)1 DataType (org.palladiosimulator.pcm.repository.DataType)1 PrimitiveDataType (org.palladiosimulator.pcm.repository.PrimitiveDataType)1 RepositoryComponent (org.palladiosimulator.pcm.repository.RepositoryComponent)1