001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019package org.apache.hadoop.conf;
020
021import java.util.Collection;
022
023/**
024 * Something whose {@link Configuration} can be changed at run time.
025 */
026public interface Reconfigurable extends Configurable {
027
028  /**
029   * Change a configuration property on this object to the value specified.
030   *
031   * Change a configuration property on this object to the value specified 
032   * and return the previous value that the configuration property was set to
033   * (or null if it was not previously set). If newVal is null, set the property
034   * to its default value;
035   *
036   * If the property cannot be changed, throw a 
037   * {@link ReconfigurationException}.
038   */
039  void reconfigureProperty(String property, String newVal)
040    throws ReconfigurationException;
041
042  /**
043   * Return whether a given property is changeable at run time.
044   *
045   * If isPropertyReconfigurable returns true for a property,
046   * then changeConf should not throw an exception when changing
047   * this property.
048   */
049  boolean isPropertyReconfigurable(String property);
050
051  /**
052   * Return all the properties that can be changed at run time.
053   */
054  Collection<String> getReconfigurableProperties();
055}