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 final ClusterEventProducer implementation and listeners are configured using plugins.
  • Constructor Details

    • ClusterEventProducerFactory

      public ClusterEventProducerFactory(CoreContainer cc)
  • Method Details

    • getSupportedEventTypes

      public Set<ClusterEvent.EventType> getSupportedEventTypes()
      Specified by:
      getSupportedEventTypes in class ClusterEventProducerBase
    • 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

      Create a ClusterEventProducer 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.