5 |
import dk.thoerup.circuitbreaker.config.BreakerConfig; |
import dk.thoerup.circuitbreaker.config.BreakerConfig; |
6 |
|
|
7 |
|
|
8 |
|
|
9 |
public final class OpenState implements CircuitBreakerState { |
public final class OpenState implements CircuitBreakerState { |
10 |
|
|
11 |
final private AtomicLong tripTime = new AtomicLong(0); |
final private AtomicLong tripTime = new AtomicLong(0); |
16 |
this.config = config; |
this.config = config; |
17 |
} |
} |
18 |
|
|
19 |
public void preInvoke(CircuitBreaker circuitBreaker) throws Exception |
|
20 |
|
public void preInvoke(CircuitBreaker<?> circuitBreaker) throws Exception |
21 |
{ |
{ |
22 |
long now = System.currentTimeMillis(); |
long now = System.currentTimeMillis(); |
23 |
long elapsed = now - tripTime.get(); |
long elapsed = now - tripTime.get(); |
32 |
} |
} |
33 |
} |
} |
34 |
|
|
35 |
public void postInvoke(CircuitBreaker circuitBreaker) throws Exception |
public void postInvoke(CircuitBreaker<?> circuitBreaker) throws Exception |
36 |
{ |
{ |
37 |
// NO OP |
// NO OP |
38 |
} |
} |
39 |
|
|
40 |
public void onError(CircuitBreaker circuitBreaker, Exception t) throws Exception |
public void onError(CircuitBreaker<?> circuitBreaker, Exception t) throws Exception |
41 |
{ |
{ |
42 |
// NO OP |
// NO OP |
43 |
} |
} |