murblanc commented on a change in pull request #1962:
URL: https://github.com/apache/lucene-solr/pull/1962#discussion_r517207532
##########
File path:
solr/core/src/java/org/apache/solr/cluster/events/impl/ClusterEventProducerFactory.java
##########
@@ -0,0 +1,173 @@
+package org.apache.solr.cluster.events.impl;
+
+import org.apache.solr.api.ContainerPluginsRegistry;
+import org.apache.solr.cluster.events.ClusterEvent;
+import org.apache.solr.cluster.events.ClusterEventListener;
+import org.apache.solr.cluster.events.ClusterEventProducer;
+import org.apache.solr.cluster.events.ClusterEventProducerBase;
+import org.apache.solr.cluster.events.NoOpProducer;
+import org.apache.solr.core.CoreContainer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.invoke.MethodHandles;
+import java.util.Set;
+
+/**
+ * This class helps in handling the initial registration of plugin-based
listeners,
+ * when both the final {@link ClusterEventProducer} implementation and
listeners
+ * are configured using plugins.
+ */
+public class ClusterEventProducerFactory extends ClusterEventProducerBase {
+ private static final Logger log =
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+ private ContainerPluginsRegistry.PluginRegistryListener
initialPluginListener;
+ private boolean created = false;
+
+ public ClusterEventProducerFactory(CoreContainer cc) {
+ super(cc);
+ initialPluginListener = new
ContainerPluginsRegistry.PluginRegistryListener() {
Review comment:
Wouldn't code be easier to read/maintain if named classes were defined
rather than anonymous ones? They would have names that help understand their
function, class javadoc etc... I feel the anonymous classes in this PR have
enough content to justify a non anonymous implementation. That's likely just a
personal preference of mine so feel free to ignore.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]