public final class NoOpSentinelProperty extends Object implements SentinelProperty<Object>
SentinelProperty that will never inform the PropertyListener on it.| Constructor and Description |
|---|
NoOpSentinelProperty() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(PropertyListener<Object> listener)
Add a
PropertyListener to this SentinelProperty. |
void |
removeListener(PropertyListener<Object> listener)
Remove the
PropertyListener on this. |
boolean |
updateValue(Object newValue)
Update the
newValue as the current value of this property and inform all PropertyListeners
added on this only when new newValue is not Equals to the old value. |
public void addListener(PropertyListener<Object> listener)
SentinelProperty
Add a PropertyListener to this SentinelProperty. After the listener is added,
SentinelProperty.updateValue(Object) will inform the listener if needed.
This method can invoke multi times to add more than one listeners.
addListener in interface SentinelProperty<Object>listener - listener to add.public void removeListener(PropertyListener<Object> listener)
SentinelPropertyPropertyListener on this. After removing, SentinelProperty.updateValue(Object)
will not inform the listener.removeListener in interface SentinelProperty<Object>listener - the listener to remove.public boolean updateValue(Object newValue)
SentinelPropertynewValue as the current value of this property and inform all PropertyListeners
added on this only when new newValue is not Equals to the old value.updateValue in interface SentinelProperty<Object>newValue - the new value.Copyright © 2019 Alibaba Group. All rights reserved.