File tree Expand file tree Collapse file tree 4 files changed +14
-87
lines changed
model/src/main/kotlin/config
plugins/api/src/main/kotlin
utils/common/src/main/kotlin Expand file tree Collapse file tree 4 files changed +14
-87
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ package org.ossreviewtoolkit.model.config
2222import com.fasterxml.jackson.annotation.JsonInclude
2323
2424import org.ossreviewtoolkit.plugins.api.PluginConfig
25- import org.ossreviewtoolkit.utils.common.Plugin
25+ import org.ossreviewtoolkit.plugins.api.PluginDescriptor
2626
2727/* *
2828 * The base configuration model of the advisor.
@@ -35,7 +35,7 @@ data class AdvisorConfiguration(
3535 val skipExcluded : Boolean = false ,
3636
3737 /* *
38- * A map with [configuration][PluginConfig] for advice providers using the [provider type][Plugin.type ] as key.
38+ * A map with [configuration][PluginConfig] for advice providers using the [plugin id][PluginDescriptor.id ] as key.
3939 */
4040 val config : Map <String , PluginConfig >? = null
4141)
Original file line number Diff line number Diff line change @@ -21,20 +21,22 @@ package org.ossreviewtoolkit.model.config
2121
2222import com.fasterxml.jackson.annotation.JsonIgnore
2323
24- import org.ossreviewtoolkit.utils.common.ConfigurablePluginFactory
24+ import org.ossreviewtoolkit.plugins.api.PluginDescriptor
25+ import org.ossreviewtoolkit.plugins.api.PluginFactory
2526import org.ossreviewtoolkit.utils.common.Options
26- import org.ossreviewtoolkit.utils.common.Plugin
2727
2828/* *
29- * The configuration of provider [plugins][ConfigurablePluginFactory ]. This class is used when multiple instances of the
29+ * The configuration of provider [plugins][PluginFactory ]. This class is used when multiple instances of the
3030 * same type of plugin should be configurable, like it is for example possible for package curation providers.
3131 * Therefore, each configured plugin gets a unique [id] in addition to the plugin [type] to be able to distinguish
3232 * different configurations for the same plugin type.
3333 */
3434data class ProviderPluginConfiguration (
3535 /* *
36- * The [type][Plugin.type ] of the provider.
36+ * The [id][PluginDescriptor.id ] of the provider plugin .
3737 */
38+ // TODO: Solve name conflict as this property refers to the plugin id, but this class already has an id property
39+ // which could be confusing.
3840 val type : String ,
3941
4042 /* *
Original file line number Diff line number Diff line change 1919
2020package org.ossreviewtoolkit.plugins.api
2121
22- import org.ossreviewtoolkit.utils.common.getLoaderFor
22+ import java.util.ServiceLoader
2323
2424/* *
2525 * A factory interface for creating plugins of type [PLUGIN]. The different plugin endpoints ORT provides must inherit
@@ -56,3 +56,8 @@ interface PluginFactory<out PLUGIN : Plugin> {
5656interface Plugin {
5757 val descriptor: PluginDescriptor
5858}
59+
60+ /* *
61+ * Return a [ServiceLoader] that is capable of loading services of type [T].
62+ */
63+ inline fun <reified T : Any > getLoaderFor (): ServiceLoader <T > = ServiceLoader .load(T ::class .java)
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments