org.apache.accumulo.core.conf
Class ObservableConfiguration

java.lang.Object
  extended by org.apache.accumulo.core.conf.AccumuloConfiguration
      extended by org.apache.accumulo.core.conf.ObservableConfiguration
All Implemented Interfaces:
Iterable<Map.Entry<String,String>>

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.AllFilter, AccumuloConfiguration.PrefixFilter, AccumuloConfiguration.PropertyFilter
 
Constructor Summary
ObservableConfiguration()
          Creates a new observable configuration.
 
Method Summary
 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, getAllPropertiesWithPrefix, getBoolean, getCount, getDefaultConfiguration, getFraction, getFraction, getMaxFilesPerTablet, getMemoryInBytes, getMemoryInBytes, getPath, getPort, getProperties, getTableConfiguration, getTimeInMillis, getTimeInMillis, instantiateClassProperty, invalidateCache, iterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservableConfiguration

public ObservableConfiguration()
Creates a new observable configuration.

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.



Copyright © 2015 Apache Accumulo Project. All rights reserved.