85 |
|
|
86 |
public void tripBreaker() { |
public void tripBreaker() { |
87 |
synchronized(this) { |
synchronized(this) { |
88 |
open.trip(); |
if (currentState != open) { // TODO:Is this conditional necessary ?? |
89 |
currentState = open; |
open.trip(); |
90 |
|
currentState = open; |
91 |
|
|
92 |
notifier.sendNotification(name, Notifier.Event.BreakerTripped); |
notifier.sendNotification(name, Notifier.Event.BreakerTripped); |
93 |
|
} |
94 |
} |
} |
95 |
} |
} |
96 |
|
|
97 |
public void attemptReset() { |
public void attemptReset() { |
98 |
synchronized(this) { |
synchronized(this) { |
99 |
currentState = halfOpen; |
if (currentState != halfOpen) { // TODO:Is this conditional necessary ?? |
100 |
notifier.sendNotification(name, Notifier.Event.BreakerAttemptReset); |
currentState = halfOpen; |
101 |
|
notifier.sendNotification(name, Notifier.Event.BreakerAttemptReset); |
102 |
|
} |
103 |
} |
} |
104 |
|
|
105 |
} |
} |
106 |
|
|
107 |
public void reset() { |
public void reset() { |
108 |
synchronized(this) { |
synchronized(this) { |
109 |
currentState = closed; |
if (currentState != closed) { // TODO: Is this conditional necessary ?? |
110 |
notifier.sendNotification(name, Notifier.Event.BreakerReset); |
currentState = closed; |
111 |
|
notifier.sendNotification(name, Notifier.Event.BreakerReset); |
112 |
|
} |
113 |
} |
} |
114 |
} |
} |
115 |
|
|