Package org.apache.accumulo.core.conf
Class ObservableConfiguration
- java.lang.Object
-
- org.apache.accumulo.core.conf.AccumuloConfiguration
-
- org.apache.accumulo.core.conf.ObservableConfiguration
-
public abstract class ObservableConfiguration extends AccumuloConfiguration
A configuration that can be observed. Handling of observers is thread-safe.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.accumulo.core.conf.AccumuloConfiguration
AccumuloConfiguration.MatchFilter, AccumuloConfiguration.PrefixFilter, AccumuloConfiguration.PropertyFilter
-
-
Constructor Summary
Constructors Constructor Description ObservableConfiguration()
Creates a new observable configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObserver(ConfigurationObserver co)
Adds an observer.void
expireAllObservers()
Expires all observers.Collection<ConfigurationObserver>
getObservers()
Gets the current set of observers.void
propertiesChanged()
Notifies all observers that properties changed.void
propertyChanged(String key)
Notifies all observers that a property changed.void
removeObserver(ConfigurationObserver co)
Removes an observer.-
Methods inherited from class org.apache.accumulo.core.conf.AccumuloConfiguration
get, get, getAllPropertiesWithPrefix, getBoolean, getCount, getDefaultConfiguration, getFraction, getFraction, getMaxFilesPerTablet, getMemoryInBytes, getMemoryInBytes, getPath, getPort, getProperties, getTableConfiguration, getTimeInMillis, getTimeInMillis, getUpdateCount, instantiateClassProperty, invalidateCache, iterator
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
addObserver
public void addObserver(ConfigurationObserver co)
Adds an observer.- Parameters:
co
- observer- Throws:
NullPointerException
- if co is null
-
removeObserver
public void removeObserver(ConfigurationObserver co)
Removes an observer.- Parameters:
co
- observer
-
getObservers
public Collection<ConfigurationObserver> getObservers()
Gets the current set of observers. The returned collection is a snapshot, and changes to it do not reflect back to the configuration.- Returns:
- observers
-
expireAllObservers
public void expireAllObservers()
Expires all observers.
-
propertyChanged
public void propertyChanged(String key)
Notifies all observers that a property changed.- Parameters:
key
- configuration property key
-
propertiesChanged
public void propertiesChanged()
Notifies all observers that properties changed.
-
-