public final class AnalysisSPILoader<S extends AbstractAnalysisFactory> extends Object
Constructor and Description |
---|
AnalysisSPILoader(Class<S> clazz) |
AnalysisSPILoader(Class<S> clazz,
ClassLoader loader) |
AnalysisSPILoader(Class<S> clazz,
String[] suffixes) |
AnalysisSPILoader(Class<S> clazz,
String[] suffixes,
ClassLoader classloader) |
Modifier and Type | Method and Description |
---|---|
Set<String> |
availableServices() |
Class<? extends S> |
lookupClass(String name) |
static <T extends AbstractAnalysisFactory> |
newFactoryClassInstance(Class<T> clazz,
Map<String,String> args)
Creates a new instance of the given
AbstractAnalysisFactory by invoking the constructor, passing the given argument map. |
S |
newInstance(String name,
Map<String,String> args) |
void |
reload(ClassLoader classloader)
Reloads the internal SPI list from the given
ClassLoader . |
public AnalysisSPILoader(Class<S> clazz, ClassLoader loader)
public AnalysisSPILoader(Class<S> clazz, String[] suffixes, ClassLoader classloader)
public void reload(ClassLoader classloader)
ClassLoader
.
Changes to the service list are visible after the method ends, all
iterators (e.g., from availableServices()
,...) 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 <T extends AbstractAnalysisFactory> T newFactoryClassInstance(Class<T> clazz, Map<String,String> args)
AbstractAnalysisFactory
by invoking the constructor, passing the given argument map.Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.