All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fabric3.spi.discovery.ConfigurationAgent Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
package org.fabric3.spi.discovery;

import java.util.function.Consumer;

/**
 * An agent that provides configuration values (e.g. for properties) from an external source such as a key/value store.
 */
public interface ConfigurationAgent {

    /**
     * Returns the value for the key or null if not found.
     *
     * @param key the key
     * @return the value or null
     */
    String getValue(String key);

    /**
     * Registers a value change listener
     *
     * @param key      the key to listen for
     * @param listener the callback to invoke when a value changes
     */
    void registerListener(String key, Consumer listener);

    /**
     * Un-Registers a value change listener
     *
     * @param key the key to listen for
     * @param listener the listener
     */
    void unregisterListener(String key, Consumer listener);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy