NamedSPILoader

class NamedSPILoader<S : NamedSPILoader.NamedSPI>(clazz: KClass<S>, classloader: ClassLoader? = null) : Iterable<S>

Helper class for loading named SPIs from classpath (e.g. Codec, PostingsFormat).

Constructors

Link copied to clipboard
constructor(clazz: KClass<S>, classloader: ClassLoader? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface NamedSPI

Interface to support NamedSPILoader.lookup by name.

Functions

Link copied to clipboard
Link copied to clipboard
open operator override fun iterator(): MutableIterator<S>
Link copied to clipboard
fun lookup(name: String): S
Link copied to clipboard
fun reload(classloader: ClassLoader?)

Reloads the internal SPI list from the given ClassLoader. Changes to the service list are visible after the method ends, all iterators (.iterator,...) stay consistent.