|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.util.NamedSPILoader<S>
public final class NamedSPILoader<S extends NamedSPILoader.NamedSPI>
Helper class for loading named SPIs from classpath (e.g. Codec, PostingsFormat).
Nested Class Summary | |
---|---|
static interface |
NamedSPILoader.NamedSPI
Interface to support lookup(String) by name. |
Constructor Summary | |
---|---|
NamedSPILoader(Class<S> clazz)
|
|
NamedSPILoader(Class<S> clazz,
ClassLoader classloader)
|
Method Summary | |
---|---|
Set<String> |
availableServices()
|
static void |
checkServiceName(String name)
Validates that a service name meets the requirements of NamedSPILoader.NamedSPI |
Iterator<S> |
iterator()
|
S |
lookup(String name)
|
void |
reload(ClassLoader classloader)
Reloads the internal SPI list from the given ClassLoader . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NamedSPILoader(Class<S> clazz)
public NamedSPILoader(Class<S> clazz, ClassLoader classloader)
Method Detail |
---|
public void reload(ClassLoader classloader)
ClassLoader
.
Changes to the service list are visible after the method ends, all
iterators (iterator()
,...) stay consistent.
NOTE: Only new service providers are added, existing ones are never removed or replaced.
This method is expensive and should only be called for discovery of new service providers on the given classpath/classloader!
public static void checkServiceName(String name)
NamedSPILoader.NamedSPI
public S lookup(String name)
public Set<String> availableServices()
public Iterator<S> iterator()
iterator
in interface Iterable<S extends NamedSPILoader.NamedSPI>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |