Turn ElectionTimeout into a proper singleton
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / base / messages / ElectionTimeout.java
index 84fa8b759014427f471b9353931eaa82e969ada1..0fdf43659ac46453f920fea6f3d9f77c75d9be0e 100644 (file)
@@ -10,6 +10,19 @@ package org.opendaylight.controller.cluster.raft.base.messages;
 
 import java.io.Serializable;
 
-public class ElectionTimeout implements Serializable {
+/**
+ * Message sent to indicate the current election term has timed out.
+ */
+public final class ElectionTimeout implements Serializable {
     private static final long serialVersionUID = 1L;
+    public static final ElectionTimeout INSTANCE = new ElectionTimeout();
+
+    private ElectionTimeout() {
+        // Hidden on purpose
+    }
+
+    @SuppressWarnings({ "static-method", "unused" })
+    private ElectionTimeout readResolve() {
+        return INSTANCE;
+    }
 }