1 |
package dk.thoerup.curcuitbreaker; |
package dk.thoerup.circuitbreaker; |
2 |
|
|
3 |
|
|
4 |
import dk.thoerup.curcuitbreaker.notification.Notifier; |
import dk.thoerup.circuitbreaker.notification.Notifier; |
5 |
import dk.thoerup.curcuitbreaker.notification.NullNotifier; |
import dk.thoerup.circuitbreaker.notification.NullNotifier; |
6 |
|
|
7 |
/* Simple CircuitBreaker implementation - snipped from http://www.jroller.com/kenwdelong/entry/circuit_breaker_in_java |
/* Simple CircuitBreaker implementation - snipped from http://www.jroller.com/kenwdelong/entry/circuit_breaker_in_java |
8 |
* |
* |
58 |
open.setTimeout(timeoutMS); |
open.setTimeout(timeoutMS); |
59 |
|
|
60 |
this.name = name; |
this.name = name; |
61 |
|
|
62 |
reset(); |
// Initial state is closed - like a reset() was called initially |
63 |
|
closed.resetFailureCount(); |
64 |
|
currentState = closed; |
65 |
} |
} |
66 |
|
|
67 |
|
|