Package org.apache.solr.api
Class ContainerPluginsRegistry
- java.lang.Object
-
- org.apache.solr.api.ContainerPluginsRegistry
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.solr.common.cloud.ClusterPropertiesListener
,org.apache.solr.common.MapSerializable
,org.apache.solr.common.MapWriter
,org.apache.solr.common.NavigableObject
,org.noggit.JSONWriter.Writable
public class ContainerPluginsRegistry extends Object implements org.apache.solr.common.cloud.ClusterPropertiesListener, org.apache.solr.common.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.
-
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 org.apache.solr.common.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(org.apache.solr.common.MapWriter.EntryWriter ew)
-
-
-
Constructor Detail
-
ContainerPluginsRegistry
public ContainerPluginsRegistry(CoreContainer coreContainer, ApiBag apiBag)
-
-
Method Detail
-
onChange
public boolean onChange(Map<String,Object> properties)
- Specified by:
onChange
in interfaceorg.apache.solr.common.cloud.ClusterPropertiesListener
-
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(org.apache.solr.common.MapWriter.EntryWriter ew) throws IOException
- Specified by:
writeMap
in interfaceorg.apache.solr.common.MapWriter
- 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 org.apache.solr.common.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
-
-