package fault;

import fault.concurrent.DefaultResilientPromise;
import fault.concurrent.ResilientFuture;
import fault.concurrent.ResilientPromise;
import fault.utils.ResilientPatternAction;

/**
 * Created by timbrooks on 6/4/15.
 */
public class LoadBalancer<T, C> implements Pattern {

    @Override
    public ResilientFuture<T> submitAction(ResilientPatternAction action, long millisTimeout) {
        return submitAction(action, new DefaultResilientPromise(), null, millisTimeout);
    }

    @Override
    public ResilientFuture<T> submitAction(ResilientPatternAction action, ResilientCallback callback,
                                           long millisTimeout) {
        return null;
    }

    @Override
    public ResilientFuture<T> submitAction(ResilientPatternAction action, ResilientPromise promise,
                                           long millisTimeout) {
        return null;
    }

    @Override
    public ResilientFuture<T> submitAction(ResilientPatternAction action, ResilientPromise promise,
                                           ResilientCallback callback, long millisTimeout) {
        return null;
    }

    @Override
    public ResilientPromise<T> performAction(ResilientPatternAction action) {
        return null;
    }
}

@@ -258,11 +258,8 @@
 cer%3C
-T, 
 C%3E i
@@ -275,16 +275,19 @@
  Pattern
+%3CC%3E
  %7B%0A%0A    
@@ -298,32 +298,36 @@
 rride%0A    public
+ %3CT%3E
  ResilientFuture
@@ -357,32 +357,38 @@
 entPatternAction
+%3CT, C%3E
  action, long mi
@@ -465,16 +465,19 @@
 tPromise
+%3CT%3E
 (), null
@@ -517,32 +517,36 @@
 rride%0A    public
+ %3CT%3E
  ResilientFuture
@@ -576,32 +576,38 @@
 entPatternAction
+%3CT, C%3E
  action, Resilie
@@ -608,32 +608,35 @@
 esilientCallback
+%3CT%3E
  callback,%0A     
@@ -665,32 +665,36 @@
                 
+    
 long millisTimeo
@@ -706,36 +706,111 @@
 %0A        return 
-null
+submitAction(action, new DefaultResilientPromise%3CT%3E(), callback, millisTimeout)
 ;%0A    %7D%0A%0A    @Ov
@@ -818,32 +818,36 @@
 rride%0A    public
+ %3CT%3E
  ResilientFuture
@@ -877,32 +877,38 @@
 entPatternAction
+%3CT, C%3E
  action, Resilie
@@ -908,32 +908,35 @@
 ResilientPromise
+%3CT%3E
  promise,%0A      
@@ -921,32 +921,36 @@
 ise%3CT%3E promise,%0A
+    
                 
@@ -1005,36 +1005,82 @@
 %0A        return 
-null
+submitAction(action, promise, null, millisTimeout)
 ;%0A    %7D%0A%0A    @Ov
@@ -1088,32 +1088,36 @@
 rride%0A    public
+ %3CT%3E
  ResilientFuture
@@ -1151,24 +1151,30 @@
 atternAction
+%3CT, C%3E
  action, Res
@@ -1186,16 +1186,19 @@
 tPromise
+%3CT%3E
  promise
@@ -1191,32 +1191,36 @@
 ise%3CT%3E promise,%0A
+    
                 
@@ -1263,16 +1263,19 @@
 Callback
+%3CT%3E
  callbac
@@ -1306,36 +1306,86 @@
 %0A        return 
-null
+submitAction(action, promise, callback, millisTimeout)
 ;%0A    %7D%0A%0A    @Ov
@@ -1401,16 +1401,20 @@
   public
+ %3CT%3E
  Resilie
@@ -1462,16 +1462,22 @@
 rnAction
+%3CT, C%3E
  action)

Fix type relationship. And have methods calls each other