KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > config > ConfigFactory


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.config;
8
9
10 /**
11  * <p>
12  * This interface describes the factory that is used to
13  * create instances of the {@link ConfigBuilder ConfigBuilder}
14  * interface. These factories are used by the {@link
15  * ConfigMediator ConfigMediator} during configuration
16  * parsing and building.
17  * </p>
18  *
19  * <p>
20  * If a ConfigFactory implementation needs to be used by the
21  * mediator, it needs to be setup or registered with the
22  * {@link ConfigFactoryRegistry ConfigFactoryRegistry} class
23  * so that the mediator can locate it.
24  * </p>
25  *
26  * <p>
27  * This factory is also responsible for constructing
28  * instances of the {@link ConfigRegistry ConfigRegistry}.
29  * The Mediator attempts to construct a ConfigRegistry for
30  * each sub-system using the factory for that sub-system.
31  * </p>
32  *
33  * @author Brian Pontarelli
34  * @since 2.0
35  * @version 2.0
36  */

37 public interface ConfigFactory {
38
39     /**
40      * <p>
41      * Creates a new instance or returns a cached instance of the ConfigBuilder
42      * that is used to build the configuration for the sub-system that the
43      * factory implementation belongs to.
44      * </p>
45      *
46      * @return The ConfigBuilder and never null
47      */

48     ConfigBuilder createBuilder();
49
50     /**
51      * <p>
52      * Creates a new instance of returns a cached instance of the ConfigRegistry
53      * that is used by the sub-system that the factory implementaiton belongs to.
54      * </p>
55      *
56      * @return The ConfigRegistry or null if the sub-system does not require a
57      * ConfigRegistry
58      */

59     ConfigRegistry createRegistry();
60 }
Popular Tags