Class DelegatingClusterEventProducer
- java.lang.Object
-
- org.apache.solr.cluster.events.ClusterEventProducerBase
-
- org.apache.solr.cluster.events.impl.DelegatingClusterEventProducer
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ClusterSingleton,ClusterEventProducer
public final class DelegatingClusterEventProducer extends ClusterEventProducerBase
This implementation allows Solr to dynamically change the underlying implementation ofClusterEventProducerin response to the changed plugin configuration.
-
-
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 DelegatingClusterEventProducer(CoreContainer cc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Set<ClusterEvent.EventType>getSupportedEventTypes()voidregisterListener(ClusterEventListener listener, ClusterEvent.EventType... eventTypes)Register an event listener for processing the specified event types.voidsetDelegate(ClusterEventProducer newDelegate)voidsetDelegationPhaser(Phaser phaser)A phaser that will advance phases every timesetDelegate(ClusterEventProducer)is called.voidstart()Start the operation of the component.voidstop()Stop the operation of the component.voidunregisterListener(ClusterEventListener listener, ClusterEvent.EventType... eventTypes)Unregister an event listener for specified event types.-
Methods inherited from class org.apache.solr.cluster.events.ClusterEventProducerBase
fireEvent, getState
-
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
-
DelegatingClusterEventProducer
public DelegatingClusterEventProducer(CoreContainer cc)
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classClusterEventProducerBase- Throws:
IOException
-
setDelegationPhaser
public void setDelegationPhaser(Phaser phaser)
A phaser that will advance phases every timesetDelegate(ClusterEventProducer)is called. Useful for allowing tests to know when a new delegate is finished getting set.
-
setDelegate
public void setDelegate(ClusterEventProducer newDelegate)
-
registerListener
public void registerListener(ClusterEventListener listener, ClusterEvent.EventType... eventTypes)
Description copied from interface:ClusterEventProducerRegister an event listener for processing the specified event types.- Specified by:
registerListenerin interfaceClusterEventProducer- Overrides:
registerListenerin classClusterEventProducerBase- Parameters:
listener- non-null listener. If the same instance of the listener is already registered for some event types then it will be also registered for additional event types specified in this call.eventTypes- event types that this listener is being registered for. If this is null or empty then all types will be used.
-
unregisterListener
public void unregisterListener(ClusterEventListener listener, ClusterEvent.EventType... eventTypes)
Description copied from interface:ClusterEventProducerUnregister an event listener for specified event types.- Specified by:
unregisterListenerin interfaceClusterEventProducer- Overrides:
unregisterListenerin classClusterEventProducerBase- Parameters:
listener- non-null listener.eventTypes- event types from which the listener will be unregistered. If this is null or empty then all event types will be used
-
start
public void start() throws ExceptionDescription 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.
-
getSupportedEventTypes
public Set<ClusterEvent.EventType> getSupportedEventTypes()
- Specified by:
getSupportedEventTypesin classClusterEventProducerBase
-
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.
-
-