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 |
|
|
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); |
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); |