X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=applications%2Fforwardingrules-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fapplications%2Ffrm%2Fimpl%2FAbstractListeningCommiter.java;h=731232da9a71f552e1fa6ffca14518d5cafc4b88;hb=777c94332871b8c34f56f7f2010de1536cb759ba;hp=f7145b82ccaa23c03351a2a42e1f00b089eaafca;hpb=ed4d25aecaabfe181dbb114d4666f3a05f3531fb;p=openflowplugin.git diff --git a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java index f7145b82cc..731232da9a 100644 --- a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java +++ b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java @@ -12,6 +12,7 @@ import static java.util.Objects.requireNonNull; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.MoreExecutors; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.Collection; import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.mdsal.binding.api.DataBroker; @@ -44,12 +45,15 @@ public abstract class AbstractListeningCommiter protected final ListenerRegistrationHelper registrationHelper; protected ListenerRegistration listenerRegistration; - public AbstractListeningCommiter(final ForwardingRulesManager provider, final DataBroker dataBroker, + @SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR", justification = "See FIXME below") + protected AbstractListeningCommiter(final ForwardingRulesManager provider, final DataBroker dataBroker, final ListenerRegistrationHelper registrationHelper) { this.provider = requireNonNull(provider, "ForwardingRulesManager can not be null!"); this.nodeConfigurator = requireNonNull(provider.getNodeConfigurator(), "NodeConfigurator can not be null!"); this.dataBroker = requireNonNull(dataBroker, "DataBroker can not be null!"); this.registrationHelper = requireNonNull(registrationHelper, "registrationHelper can not be null!"); + + // FIXME: this may start listening on an uninitialized object: clean up the lifecycle here registerListener(); provider.addRecoverableListener(this); } @@ -112,7 +116,7 @@ public abstract class AbstractListeningCommiter } @Override - public void registerListener() { + public final void registerListener() { final DataTreeIdentifier treeId = DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, getWildCardPath()); Futures.addCallback(registrationHelper.checkedRegisterListener(treeId, this),