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 fromClusterPluginsSource.plugins()
.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.
-
Field Summary
Fields Modifier and Type Field Description static String
CLUSTER_PLUGIN_EDIT_ENABLED
-
Constructor Summary
Constructors Constructor Description ContainerPluginsRegistry(CoreContainer coreContainer, ApiBag apiBag, ClusterPluginsSource pluginsSource)
-
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)
static org.apache.solr.common.MapWriter
configure(Object instance, Map<String,Object> config, org.apache.solr.client.solrj.request.beans.PluginMeta meta)
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)
-
-
-
Field Detail
-
CLUSTER_PLUGIN_EDIT_ENABLED
public static final String CLUSTER_PLUGIN_EDIT_ENABLED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ContainerPluginsRegistry
public ContainerPluginsRegistry(CoreContainer coreContainer, ApiBag apiBag, ClusterPluginsSource pluginsSource)
-
-
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()
-
configure
public static org.apache.solr.common.MapWriter configure(Object instance, Map<String,Object> config, org.apache.solr.client.solrj.request.beans.PluginMeta meta) throws IOException
- Throws:
IOException
-
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
-
-