Source code: ojb/broker/util/configuration/Configurator.java
1 /*
2 * ObJectRelationalBridge - Bridging Java Objects and Relational Databases
3 * http://objectbridge.sourceforge.net
4 * Copyright (C) 2000, 2001 Thomas Mahler, et al.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 package ojb.broker.util.configuration;
21
22 import ojb.broker.util.logging.Logger;
23
24 /**
25 * Interface für Konfiguratoren, sprich Objekte, die andere Objekte konfigurieren können.
26 *
27 * Ablauf:
28 * Eine Komponente (ein Objekt) holt sich einen Konfigurator (z.B. über eine Factory) und
29 * bittet den Konfigurator "lieber Konfigurator konfiguriere mich":
30 *
31 * <pre>
32 * Configurable obj = ...
33 * Configurator configurator = new FileBasedConfigurator();
34 * configurator.configure(obj);
35 * </pre>
36 *
37 * @author Thomas Mahler
38 * @version $Id: Configurator.java,v 1.3 2002/05/04 16:53:38 mpoeschl Exp $
39 */
40 public interface Configurator
41 {
42
43 /** erlaubt die Übergabe eines log4j loggers an den Konfigurator*/
44 public void setLogger(Logger logger);
45
46 /** führt die Konfiguration für das konfigurierbare target aus.*/
47 public void configure(Configurable target) throws ConfigurationException;
48
49 /** holt die Konfiguration für das konfigurierbare target.*/
50 public Configuration getConfigurationFor(Configurable target) throws ConfigurationException;
51 }