-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tmf: Support for configuration sources to create data providers
Updated org.eclipse.tracecompass.tmf.core.config extension point: - add data provider configuration source ITmfDataProviderConfigSource - make global ITmfConfigurationSource - Update TmfConfigurationSourceManager to handle update extension point Introduce API ITmfDataProviderSource to implement for getting a list of data provider descriptors for a given trace, data provider ID and config ID. Implementers need to make sure that data provider factories are registered to the DataProviderManager, that the new list are also returned by DataProviderProvider#getDescriptors() and data providers can be instantiated with it. [Added] Support for configuration sources to create data providers [Updated] org.eclipse.tracecompass.tmf.core.config extension point Signed-off-by: Bernd Hufmann <[email protected]>
- Loading branch information
Showing
8 changed files
with
266 additions
and
20 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
tmf/org.eclipse.tracecompass.tmf.core/.settings/.api_filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<component id="org.eclipse.tracecompass.tmf.core" version="2"> | ||
<resource path="src/org/eclipse/tracecompass/tmf/core/config/TmfConfigurationSourceManager.java" type="org.eclipse.tracecompass.tmf.core.config.TmfConfigurationSourceManager"> | ||
<filter comment="Static variable was not supposed to be public. It's pretty new and save to make it private." id="388018290"> | ||
<message_arguments> | ||
<message_argument value="org.eclipse.tracecompass.tmf.core.config.TmfConfigurationSourceManager"/> | ||
<message_argument value="CONFIG_EXTENSION_POINT_ID"/> | ||
</message_arguments> | ||
</filter> | ||
<filter comment="Static variable was not supposed to be public. It's pretty new and save to make it private." id="388018290"> | ||
<message_arguments> | ||
<message_argument value="org.eclipse.tracecompass.tmf.core.config.TmfConfigurationSourceManager"/> | ||
<message_argument value="SOURCE_ATTR"/> | ||
</message_arguments> | ||
</filter> | ||
<filter comment="Static variable was not supposed to be public. It's pretty new and save to make it private." id="388018290"> | ||
<message_arguments> | ||
<message_argument value="org.eclipse.tracecompass.tmf.core.config.TmfConfigurationSourceManager"/> | ||
<message_argument value="SOURCE_TYPE_ELEM"/> | ||
</message_arguments> | ||
</filter> | ||
</resource> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...s.tmf.core/src/org/eclipse/tracecompass/tmf/core/config/ITmfDataProviderConfigSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Ericsson | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License 2.0 which | ||
* accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.tracecompass.tmf.core.config; | ||
|
||
import java.util.Map; | ||
|
||
import org.eclipse.jdt.annotation.Nullable; | ||
import org.eclipse.tracecompass.tmf.core.exceptions.TmfConfigurationException; | ||
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; | ||
|
||
/** | ||
* Interface for configuring data providers for given experiment. | ||
* | ||
* @since 9.5 | ||
*/ | ||
public interface ITmfDataProviderConfigSource { | ||
|
||
/** | ||
* @return {@link ITmfConfigurationSourceType} of this configuration source | ||
*/ | ||
ITmfConfigurationSourceType getConfigurationSourceType(); | ||
|
||
/** | ||
* Check if a this configuration source is applies to a give data provider. | ||
* | ||
* @param dataProviderId | ||
* the data provider ID | ||
* @return true if it applies else false | ||
*/ | ||
boolean appliesToDataProvider(String dataProviderId); | ||
|
||
/** | ||
* Create a list of data provider descriptors base on input parameters. | ||
* | ||
* @param parameters | ||
* The input parameter | ||
* @param trace | ||
* The trace (or experiment) instance | ||
* @param srcDataProviderId | ||
* The sourceDataProviderId | ||
* @return a new {@link ITmfConfiguration} if successful | ||
* @throws TmfConfigurationException | ||
* If the creation of the configuration fails | ||
*/ | ||
ITmfConfiguration create(Map<String, Object> parameters, ITmfTrace trace, String srcDataProviderId) throws TmfConfigurationException; | ||
|
||
/** | ||
* Removes a configuration instance. | ||
* | ||
* @param id | ||
* The configuration ID of the configuration to remove | ||
* @param trace | ||
* The trace (or experiment) instance | ||
* @param srcDataProviderId | ||
* The sourceDataProviderId | ||
* @return removed {@link ITmfConfiguration} instance if remove or null if | ||
* not found | ||
*/ | ||
@Nullable ITmfConfiguration remove(String id, ITmfTrace trace, String srcDataProviderId); | ||
|
||
/** | ||
* Dispose the configuration source. | ||
*/ | ||
void dispose(); | ||
} |
41 changes: 41 additions & 0 deletions
41
...compass.tmf.core/src/org/eclipse/tracecompass/tmf/core/config/ITmfDataProviderSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Ericsson | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License 2.0 which | ||
* accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.tracecompass.tmf.core.config; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.tracecompass.tmf.core.dataprovider.DataProviderManager; | ||
import org.eclipse.tracecompass.tmf.core.dataprovider.IDataProviderDescriptor; | ||
import org.eclipse.tracecompass.tmf.core.exceptions.TmfConfigurationException; | ||
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; | ||
|
||
/** | ||
* Interface for creating data providers. Implementers only return the data provider descriptors. | ||
* Instantiating the actual data provider(s) should be done using {@link DataProviderManager}. | ||
* @since 9.5 | ||
*/ | ||
public interface ITmfDataProviderSource { | ||
/** | ||
* Create a list of data provider descriptors base on input parameters. | ||
* | ||
* @param srcDataProviderId | ||
* The sourceDataProviderId | ||
* @param trace | ||
* The trace (or experiment) instance | ||
* @param configId | ||
* The configuration ID | ||
* @return List of data provider descriptor | ||
* @throws TmfConfigurationException | ||
* if an error occurs | ||
*/ | ||
List<IDataProviderDescriptor> getDataProviderDescriptors(String srcDataProviderId, ITmfTrace trace, String configId) throws TmfConfigurationException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters