     * @param Int              retryTimeout how many seconds should we wait before retry
     * @return CircuitBreaker
     */
-    func setServiceSettings(serviceName:String, maxFailures:Int, retryTimeout:Int) -> CircuitBreakerProtocol {
+    func setServiceSettings(serviceName:String, maxFailures:Int, retryTimeout:Int) -> CircuitBreaker {
         self.settings[serviceName]? = ["maxFailures": (maxFailures != 0) ? maxFailures : self.defaultMaxFailures]
         self.settings[serviceName]? = ["retryTimeout": (retryTimeout != 0) ? retryTimeout : self.defaultRetryTimeout]
         return self;

@objc
public class ShortCircuitFactory : NSObject {
  
  public static func getInMemoryInstance(maxFailures:Int = 20, retryTimeout:Int = 20) -> CircuitBreakerProtocol {
    let storage = MemoryAdapter()
    return ShortCircuit(storage: storage, maxFailures: maxFailures, retryTimeout: retryTimeout)
  }
  
  public static func getNSUserDefaultsInstance(maxFailures:Int = 20, retryTimeout:Int = 20) -> CircuitBreakerProtocol {
    let storage = NSUserDefaultsAdapter()
    return ShortCircuit(storage: storage, maxFailures: maxFailures, retryTimeout: retryTimeout)
  }
}

@objc
public class ShortCircuit : NSObject, CircuitBreakerProtocol {
    
    var storageAdapter:CircuitBreakerStorageProtocol
    
    var defaultMaxFailures:Int
    

}

@objc
class BaseAdapter : NSObject, CircuitBreakerStorage {
 
    /**
     how long the stats array should persist in cache
