public class PackageListeningClassLoader extends Object implements SolrClassLoader, PackageListeners.Listener
SolrClassLoader
that is designed to listen to a set of packages.
This class registers a listener for each package that is loaded through this.
If any of those packages are updated, the onReload runnable is runPackageListeners.Listener.Ctx
Constructor and Description |
---|
PackageListeningClassLoader(CoreContainer coreContainer,
SolrResourceLoader coreResourceLoader,
Function<String,String> pkgVersionSupplier,
Runnable onReload) |
Modifier and Type | Method and Description |
---|---|
void |
changed(PackageLoader.Package pkg,
PackageListeners.Listener.Ctx ctx)
A callback when the package is updated
|
<T> Class<? extends T> |
findClass(String cname,
Class<T> expectedType) |
MapWriter |
getPackageVersion(PluginInfo.ClassName cName) |
<T> T |
newInstance(String cname,
Class<T> expectedType,
String... subpackages) |
<T> T |
newInstance(String cname,
Class<T> expectedType,
String[] subPackages,
Class[] params,
Object[] args) |
String |
packageName()
Name of the package or null to listen to all package changes
|
PluginInfo |
pluginInfo() |
public PackageListeningClassLoader(CoreContainer coreContainer, SolrResourceLoader coreResourceLoader, Function<String,String> pkgVersionSupplier, Runnable onReload)
public <T> T newInstance(String cname, Class<T> expectedType, String... subpackages)
newInstance
in interface SolrClassLoader
public MapWriter getPackageVersion(PluginInfo.ClassName cName)
getPackageVersion
in interface PackageListeners.Listener
public <T> T newInstance(String cname, Class<T> expectedType, String[] subPackages, Class[] params, Object[] args)
newInstance
in interface SolrClassLoader
public <T> Class<? extends T> findClass(String cname, Class<T> expectedType)
findClass
in interface SolrClassLoader
public String packageName()
PackageListeners.Listener
packageName
in interface PackageListeners.Listener
public PluginInfo pluginInfo()
pluginInfo
in interface PackageListeners.Listener
public void changed(PackageLoader.Package pkg, PackageListeners.Listener.Ctx ctx)
PackageListeners.Listener
changed
in interface PackageListeners.Listener
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.