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
This class helps in handling the initial registration of plugin-based listeners, when both the
final
ClusterEventProducer 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, stateFields inherited from interface org.apache.solr.cluster.events.ClusterEventProducer
PLUGIN_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(ContainerPluginsRegistry plugins) Create aClusterEventProducerbased on the current plugin configurations.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.voidstart()Start the operation of the component.voidstop()Stop the operation of the component.Methods inherited from class org.apache.solr.cluster.events.ClusterEventProducerBase
close, fireEvent, getState, registerListener, unregisterListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.cluster.events.ClusterEventProducer
getName, unregisterListener
-
Constructor Details
-
ClusterEventProducerFactory
-
-
Method Details
-
getSupportedEventTypes
- Specified by:
getSupportedEventTypesin classClusterEventProducerBase
-
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
Create aClusterEventProducerbased 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
Description copied from interface:ClusterSingletonStart 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:ClusterSingletonStop 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.
-