com.netflix.config
Class AbstractDynamicPropertyListener

java.lang.Object
  extended by com.netflix.config.AbstractDynamicPropertyListener
All Implemented Interfaces:
PropertyListener

public abstract class AbstractDynamicPropertyListener
extends java.lang.Object
implements PropertyListener

An abstract PropertyListener for use by different components who need to listen for configuration changes. Users only need to implement the handlePropertyEvent(String, Object, EventType) method.


Nested Class Summary
static class AbstractDynamicPropertyListener.EventType
           
 
Constructor Summary
AbstractDynamicPropertyListener()
           
 
Method Summary
 void addProperty(java.lang.Object source, java.lang.String name, java.lang.Object value, boolean beforeUpdate)
          Notifies this listener about a new value for the given property.
 void clear(java.lang.Object source, boolean beforeUpdate)
          Notifies this listener that all properties have been cleared.
 void clearProperty(java.lang.Object source, java.lang.String name, java.lang.Object value, boolean beforeUpdate)
          Notifies this listener about a cleared property, which now has no value.
 void configSourceLoaded(java.lang.Object source)
          Notifies this listener about a new source of configuration being invalidated and/or added
abstract  void handlePropertyEvent(java.lang.String name, java.lang.Object value, AbstractDynamicPropertyListener.EventType eventType)
           
 void setProperty(java.lang.Object source, java.lang.String name, java.lang.Object value, boolean beforeUpdate)
          Notifies this listener about a changed value for the given property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDynamicPropertyListener

public AbstractDynamicPropertyListener()
Method Detail

addProperty

public void addProperty(java.lang.Object source,
                        java.lang.String name,
                        java.lang.Object value,
                        boolean beforeUpdate)
Description copied from interface: PropertyListener

Notifies this listener about a new value for the given property.

Specified by:
addProperty in interface PropertyListener
Parameters:
source - the event source.
name - the property name.
value - the property value (current value if beforeUpdate is true, otherwise the new value).
beforeUpdate - true if this callback is occuring before the property has changed.

clear

public void clear(java.lang.Object source,
                  boolean beforeUpdate)
Description copied from interface: PropertyListener

Notifies this listener that all properties have been cleared.

Specified by:
clear in interface PropertyListener
Parameters:
source - the event source.
beforeUpdate - true if this callback is occuring before the properties have been cleared.

clearProperty

public void clearProperty(java.lang.Object source,
                          java.lang.String name,
                          java.lang.Object value,
                          boolean beforeUpdate)
Description copied from interface: PropertyListener

Notifies this listener about a cleared property, which now has no value.

Specified by:
clearProperty in interface PropertyListener
Parameters:
source - the event source.
name - the property name.
value - the property value (current value if beforeUpdate is true, otherwise the new value which should be null).
beforeUpdate - true if this callback is occuring before the property has changed.

configSourceLoaded

public void configSourceLoaded(java.lang.Object source)
Description copied from interface: PropertyListener

Notifies this listener about a new source of configuration being invalidated and/or added

Specified by:
configSourceLoaded in interface PropertyListener
Parameters:
source - the event source.

setProperty

public void setProperty(java.lang.Object source,
                        java.lang.String name,
                        java.lang.Object value,
                        boolean beforeUpdate)
Description copied from interface: PropertyListener

Notifies this listener about a changed value for the given property.

Specified by:
setProperty in interface PropertyListener
Parameters:
source - the event source.
name - the property name.
value - the property value (current value if beforeUpdate is true, otherwise the replacement value).
beforeUpdate - true if this callback is occuring before the property has changed.

handlePropertyEvent

public abstract void handlePropertyEvent(java.lang.String name,
                                         java.lang.Object value,
                                         AbstractDynamicPropertyListener.EventType eventType)