Package org.apache.solr.api
Class ContainerPluginsRegistry
- java.lang.Object
-
- org.apache.solr.api.ContainerPluginsRegistry
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClusterPropertiesListener
,MapSerializable
,MapWriter
,NavigableObject
public class ContainerPluginsRegistry extends Object implements ClusterPropertiesListener, MapWriter, Closeable
This class manages the container-level plugins and their Api-s. It is responsible for adding / removing / replacing the plugins according to the updated configuration obtained fromContainerPluginsApi.plugins(Supplier)
.Plugins instantiated by this class may implement zero or more
Api
-s, which are then registered in the CoreContainerApiBag
. They may be also post-processed for additional functionality byContainerPluginsRegistry.PluginRegistryListener
-s registered with this class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ContainerPluginsRegistry.ApiInfo
static class
ContainerPluginsRegistry.Diff
static interface
ContainerPluginsRegistry.PluginRegistryListener
Listener for notifications about added / deleted / modified plugins.-
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
MapWriter.EntryWriter
-
-
Constructor Summary
Constructors Constructor Description ContainerPluginsRegistry(CoreContainer coreContainer, ApiBag apiBag)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static Map<String,ContainerPluginsRegistry.Diff>
compareMaps(Map<String,?> a, Map<String,?> b)
ContainerPluginsRegistry.ApiInfo
createInfo(Map<String,Object> info, List<String> errs)
static <T extends MapWriter>
Class<T>getConfigClass(ConfigurablePlugin<T> o)
Get the generic type of aConfigurablePlugin
ContainerPluginsRegistry.ApiInfo
getPlugin(String name)
boolean
onChange(Map<String,Object> properties)
void
refresh()
void
registerListener(ContainerPluginsRegistry.PluginRegistryListener listener)
void
setPhaser(Phaser phaser)
A phaser that will advance phases every timeonChange(Map)
is called.void
unregisterListener(ContainerPluginsRegistry.PluginRegistryListener listener)
void
writeMap(MapWriter.EntryWriter ew)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
-
-
-
-
Constructor Detail
-
ContainerPluginsRegistry
public ContainerPluginsRegistry(CoreContainer coreContainer, ApiBag apiBag)
-
-
Method Detail
-
onChange
public boolean onChange(Map<String,Object> properties)
- Specified by:
onChange
in interfaceClusterPropertiesListener
-
setPhaser
public void setPhaser(Phaser phaser)
A phaser that will advance phases every timeonChange(Map)
is called. Useful for allowing tests to know when a new configuration is finished getting set.
-
registerListener
public void registerListener(ContainerPluginsRegistry.PluginRegistryListener listener)
-
unregisterListener
public void unregisterListener(ContainerPluginsRegistry.PluginRegistryListener listener)
-
writeMap
public void writeMap(MapWriter.EntryWriter ew) throws IOException
- Specified by:
writeMap
in interfaceMapWriter
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getPlugin
public ContainerPluginsRegistry.ApiInfo getPlugin(String name)
-
refresh
public void refresh()
-
getConfigClass
public static <T extends MapWriter> Class<T> getConfigClass(ConfigurablePlugin<T> o)
Get the generic type of aConfigurablePlugin
-
createInfo
public ContainerPluginsRegistry.ApiInfo createInfo(Map<String,Object> info, List<String> errs) throws IOException
- Throws:
IOException
-
-