com.netflix.config
Class ExpandedConfigurationListenerAdapter

java.lang.Object
  extended by com.netflix.config.ExpandedConfigurationListenerAdapter
All Implemented Interfaces:
org.apache.commons.configuration.event.ConfigurationListener

public class ExpandedConfigurationListenerAdapter
extends java.lang.Object
implements org.apache.commons.configuration.event.ConfigurationListener

An ExpandedConfigurationListenerAdapter wraps an instance of PropertyListener. When it receives the property modification notification from the Apache Configuration, it translates the ConfigurationEvent into the corresponding events for PropertyListener.

It also has the capability to pause the event delivery through the setPauseListener(boolean) API.

This class is used as an adapter to attach a PropertyListener to a Configuration so that methods in the PropertyListener will be called when there is a change in the configuration.


Constructor Summary
ExpandedConfigurationListenerAdapter(PropertyListener listener)
          Create a new ExpandedConfigurationListenerAdapter that wraps the provided PropertyListener.
 
Method Summary
 void configurationChanged(org.apache.commons.configuration.event.ConfigurationEvent event)
          
 boolean equals(java.lang.Object obj)
          
 PropertyListener getListener()
          Returns the wrapped PropertyListener.
 int hashCode()
          
static boolean isListenerPaused()
           
static void setPauseListener(boolean pauseListener)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpandedConfigurationListenerAdapter

public ExpandedConfigurationListenerAdapter(PropertyListener listener)

Create a new ExpandedConfigurationListenerAdapter that wraps the provided PropertyListener.

Parameters:
listener - to wrap.
Throws:
java.lang.NullPointerException - if the configuration or listener is null.
Method Detail

isListenerPaused

public static boolean isListenerPaused()

setPauseListener

public static void setPauseListener(boolean pauseListener)

getListener

public PropertyListener getListener()
Returns the wrapped PropertyListener.

Returns:
the wrapped PropertyListener.

configurationChanged

public void configurationChanged(org.apache.commons.configuration.event.ConfigurationEvent event)

Specified by:
configurationChanged in interface org.apache.commons.configuration.event.ConfigurationListener
See Also:
ConfigurationListener.configurationChanged(ConfigurationEvent)

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()