X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fclient%2Fmessages%2FShutdown.java;h=2f2ff47934ab0a4a85761c9f69fa90d98157fd7c;hb=refs%2Fchanges%2F14%2F103514%2F9;hp=4261baef2fd22f19c5374139f34f15ba063eb1b5;hpb=d3790efbca191389411dbb71f1940027f95c2c23;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/Shutdown.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/Shutdown.java index 4261baef2f..2f2ff47934 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/Shutdown.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/Shutdown.java @@ -7,7 +7,9 @@ */ package org.opendaylight.controller.cluster.raft.client.messages; +import akka.dispatch.ControlMessage; import java.io.Serializable; +import org.opendaylight.controller.cluster.raft.base.messages.EmptyExternalizableProxy; /** * Message sent to a raft actor to shutdown gracefully. If it's the leader it will transfer leadership to a @@ -16,15 +18,31 @@ import java.io.Serializable; * * @author Thomas Pantelis */ -public final class Shutdown implements Serializable { +public final class Shutdown implements Serializable, ControlMessage { + @java.io.Serial private static final long serialVersionUID = 1L; + public static final Shutdown INSTANCE = new Shutdown(); private Shutdown() { // Hidden on purpose } + @java.io.Serial private Object readResolve() { return INSTANCE; } + + @Deprecated(since = "7.0.0", forRemoval = true) + private static class Proxy extends EmptyExternalizableProxy { + @java.io.Serial + private static final long serialVersionUID = 1L; + + // checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't + // redundant. It is explicitly needed for Java serialization to be able to create instances via reflection. + @SuppressWarnings("checkstyle:RedundantModifier") + public Proxy() { + super(INSTANCE); + } + } }