public class SimpleDistributedProperty<T extends Serializable> extends Object implements DistributedChangeableProperty<T>
| Constructor and Description |
|---|
SimpleDistributedProperty(String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(DistributePropertyListener<T> listener) |
T |
get() |
String |
getName() |
T |
getOrDefault(T dfltVal) |
void |
localUpdate(Serializable newVal)
Update only local value without updating remote cluster.
|
void |
onAttached()
This property have been attached to processor.
|
void |
onReadyForUpdate(@NotNull PropertyUpdateClosure updater)
On this property ready to be update on cluster wide.
|
boolean |
propagate(T newVal)
Change value across whole cluster.
|
GridFutureAdapter<?> |
propagateAsync(T newVal)
Change value across whole cluster.
|
GridFutureAdapter<?> |
propagateAsync(T expectedVal,
T newVal)
Change value across whole cluster.
|
String |
toString() |
protected volatile T extends Serializable val
public SimpleDistributedProperty(String name)
name - Name of property.public boolean propagate(T newVal) throws IgniteCheckedException
propagate in interface DistributedProperty<T extends Serializable>newVal - Value which this property should be changed on.true if value was successfully updated and false if cluster wide update was failed,
perhaps some concurrent operation was changed this value in same moment.DetachedPropertyException - If this property have not been attached to processor yet, please call DistributedConfigurationProcessor.registerProperty(DistributedChangeableProperty) before this method.NotWritablePropertyException - If this property don't ready to cluster wide update yet, perhaps cluster is
not active yet.IgniteCheckedException - If failed during cluster wide update.public GridFutureAdapter<?> propagateAsync(T newVal) throws IgniteCheckedException
propagateAsync in interface DistributedProperty<T extends Serializable>newVal - Value which this property should be changed on.DetachedPropertyException - If this property have not been attached to processor yet, please call DistributedConfigurationProcessor.registerProperty(DistributedChangeableProperty) before this method.NotWritablePropertyException - If this property don't ready to cluster wide update yet, perhaps cluster is
not active yet.IgniteCheckedException - If failed during cluster wide update.public GridFutureAdapter<?> propagateAsync(T expectedVal, T newVal) throws IgniteCheckedException
propagateAsync in interface DistributedProperty<T extends Serializable>expectedVal - Value from which this property should be changed.newVal - Value which this property should be changed on.DetachedPropertyException - If this property have not been attached to processor yet, please call DistributedConfigurationProcessor.registerProperty(DistributedChangeableProperty) before this method.NotWritablePropertyException - If this property don't ready to cluster wide update yet, perhaps cluster is
not active yet.IgniteCheckedException - If failed during cluster wide update.public T get()
get in interface DistributedProperty<T extends Serializable>public T getOrDefault(T dfltVal)
getOrDefault in interface DistributedProperty<T extends Serializable>dfltVal - Default value when current value is null.public String getName()
getName in interface DistributedProperty<T extends Serializable>public void addListener(DistributePropertyListener<T> listener)
addListener in interface DistributedProperty<T extends Serializable>listener - Update listener.public void onAttached()
onAttached in interface DistributedChangeableProperty<T extends Serializable>public void onReadyForUpdate(@NotNull
@NotNull PropertyUpdateClosure updater)
onReadyForUpdate in interface DistributedChangeableProperty<T extends Serializable>updater - Consumer for update value across cluster.public void localUpdate(Serializable newVal)
localUpdate in interface DistributedChangeableProperty<T extends Serializable>newVal - New value.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.0 Release Date : February 27 2020