001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 * 
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 * 
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018package org.apache.log4j.spi;
019
020import java.io.InputStream;
021import java.net.URL;
022
023/**
024   Implemented by classes capable of configuring log4j using a URL.
025   
026   @since 1.0
027   @author Anders Kristensen
028 */
029public interface Configurator {
030
031  /**
032     Special level value signifying inherited behaviour. The current
033     value of this string constant is <b>inherited</b>. {@link #NULL}
034     is a synonym.  */
035  public static final String INHERITED = "inherited";
036
037  /**
038     Special level signifying inherited behaviour, same as {@link
039     #INHERITED}. The current value of this string constant is
040     <b>null</b>. */
041  public static final String NULL = "null";
042
043
044
045  /**
046    Interpret a resource pointed by a InputStream and set up log4j accordingly.
047
048    The configuration is done relative to the <code>hierarchy</code>
049    parameter.
050
051    @param inputStream The InputStream to parse
052    @param repository The hierarchy to operation upon.
053
054    @since 1.2.17
055   */
056  void doConfigure(InputStream inputStream, LoggerRepository repository);
057
058  /**
059     Interpret a resource pointed by a URL and set up log4j accordingly.
060
061     The configuration is done relative to the <code>hierarchy</code>
062     parameter.
063
064     @param url The URL to parse
065     @param repository The hierarchy to operation upon.
066   */
067  void doConfigure(URL url, LoggerRepository repository);
068}