Store failed states and fail count, too.
[rhynodge.git] / src / main / java / net / pterodactylus / reactor / states / AbstractState.java
index 674f4af..31a1d18 100644 (file)
@@ -41,6 +41,9 @@ public abstract class AbstractState implements State {
        /** The optional exception that occured while retrieving the state. */
        private final Throwable exception;
 
+       /** The number of consecutive failures. */
+       private int failCount;
+
        /**
         * Creates a new successful state.
         */
@@ -108,6 +111,22 @@ public abstract class AbstractState implements State {
         * {@inheritDoc}
         */
        @Override
+       public int failCount() {
+               return failCount;
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       public void setFailCount(int failCount) {
+               this.failCount = failCount;
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
        public Throwable exception() {
                return exception;
        }