/[projects]/miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/CircuitBreaker.java
ViewVC logotype

Diff of /miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/CircuitBreaker.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3214 by torben, Thu Dec 28 09:34:47 2017 UTC revision 3215 by torben, Thu Dec 28 13:20:04 2017 UTC
# Line 116  public class CircuitBreaker<T>{ Line 116  public class CircuitBreaker<T>{
116            
117      private void commonTripBreaker(Event event) {      private void commonTripBreaker(Event event) {
118          synchronized(this) {          synchronized(this) {
119                  if (currentState != open) { // TODO:Is this conditional necessary ??                  if (currentState != open) {
120                          open.trip();                          open.trip();
121                          currentState = open;                          currentState = open;
122                                    
# Line 128  public class CircuitBreaker<T>{ Line 128  public class CircuitBreaker<T>{
128    
129      public void attemptReset() {      public void attemptReset() {
130          synchronized(this) {          synchronized(this) {
131                  if (currentState != halfOpen) { // TODO:Is this conditional necessary ??                  if (currentState != halfOpen) {
132                          currentState = halfOpen;                          currentState = halfOpen;
133                          notifier.sendNotification(this, Event.BreakerAttemptReset);                          notifier.sendNotification(this, Event.BreakerAttemptReset);
134                          stats.addStatistics(Event.BreakerAttemptReset);                          stats.addStatistics(Event.BreakerAttemptReset);
# Line 139  public class CircuitBreaker<T>{ Line 139  public class CircuitBreaker<T>{
139            
140      public void reset() {      public void reset() {
141          synchronized(this) {          synchronized(this) {
142                  if (currentState != closed) { // TODO: Is this conditional necessary ??                  if (currentState != closed) {
143                          internalReset();                          internalReset();
144                          notifier.sendNotification(this, Event.BreakerReset);                          notifier.sendNotification(this, Event.BreakerReset);
145                          stats.addStatistics(Event.BreakerReset);                          stats.addStatistics(Event.BreakerReset);

Legend:
Removed from v.3214  
changed lines
  Added in v.3215

  ViewVC Help
Powered by ViewVC 1.1.20