Switch to ARGON raft version
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / client / messages / Shutdown.java
index 5b76685cb731c5cf9e3b9145d0585d5e67184efb..2f2ff47934ab0a4a85761c9f69fa90d98157fd7c 100644 (file)
@@ -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,16 +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
     }
 
-    @SuppressWarnings({ "static-method", "unused" })
-    private Shutdown readResolve() {
+    @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);
+        }
+    }
 }