Class ClusterEventProducerFactory
- java.lang.Object
-
- org.apache.solr.cluster.events.ClusterEventProducerBase
-
- org.apache.solr.cluster.events.impl.ClusterEventProducerFactory
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClusterSingleton
,ClusterEventProducer
public class ClusterEventProducerFactory extends ClusterEventProducerBase
This class helps in handling the initial registration of plugin-based listeners, when both the finalClusterEventProducer
implementation and listeners are configured using plugins.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.cloud.ClusterSingleton
ClusterSingleton.State
-
-
Field Summary
-
Fields inherited from class org.apache.solr.cluster.events.ClusterEventProducerBase
cc, listeners, state
-
Fields inherited from interface org.apache.solr.cluster.events.ClusterEventProducer
PLUGIN_NAME
-
-
Constructor Summary
Constructors Constructor Description ClusterEventProducerFactory(CoreContainer cc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DelegatingClusterEventProducer
create(ContainerPluginsRegistry plugins)
Create aClusterEventProducer
based on the current plugin configurations.ContainerPluginsRegistry.PluginRegistryListener
getPluginRegistryListener()
This method returns an initial plugin registry listener that helps to capture the freshly loaded listener plugins before the final cluster event producer is created.Set<ClusterEvent.EventType>
getSupportedEventTypes()
void
start()
Start the operation of the component.void
stop()
Stop the operation of the component.-
Methods inherited from class org.apache.solr.cluster.events.ClusterEventProducerBase
close, fireEvent, getState, registerListener, unregisterListener
-
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.cluster.events.ClusterEventProducer
getName, unregisterListener
-
-
-
-
Constructor Detail
-
ClusterEventProducerFactory
public ClusterEventProducerFactory(CoreContainer cc)
-
-
Method Detail
-
getSupportedEventTypes
public Set<ClusterEvent.EventType> getSupportedEventTypes()
- Specified by:
getSupportedEventTypes
in classClusterEventProducerBase
-
getPluginRegistryListener
public ContainerPluginsRegistry.PluginRegistryListener getPluginRegistryListener()
This method returns an initial plugin registry listener that helps to capture the freshly loaded listener plugins before the final cluster event producer is created.- Returns:
- initial listener
-
create
public DelegatingClusterEventProducer create(ContainerPluginsRegistry plugins)
Create aClusterEventProducer
based on the current plugin configurations.NOTE: this method can only be called once because it has side-effects, such as transferring the initially collected listeners to the resulting producer's instance, and installing a
ContainerPluginsRegistry.PluginRegistryListener
. Calling this method more than once will result in an exception.- Parameters:
plugins
- current plugin configurations- Returns:
- configured instance of cluster event producer (with side-effects, see above)
-
start
public void start() throws Exception
Description copied from interface:ClusterSingleton
Start the operation of the component. Initially this method should set the state to STARTING, and on success it should set the state to RUNNING.- Throws:
Exception
- on startup errors. The component should revert to the STOPPED state.
-
stop
public void stop()
Description copied from interface:ClusterSingleton
Stop the operation of the component. Initially this method should set the state to STOPPING, and on return it should set the state to STOPPED. Components should also avoid holding any resource when in STOPPED state.
-
-