KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > base > modules > Module


1 /* ========================================================================
2  * JCommon : a free general purpose class library for the Java(tm) platform
3  * ========================================================================
4  *
5  * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
6  *
7  * Project Info: http://www.jfree.org/jcommon/index.html
8  *
9  * This library is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  * License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22  * USA.
23  *
24  * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
25  * in the United States and other countries.]
26  *
27  * -----------
28  * Module.java
29  * -----------
30  * (C)opyright 2004, by Thomas Morgner and Contributors.
31  *
32  * Original Author: Thomas Morgner;
33  * Contributor(s): David Gilbert (for Object Refinery Limited);
34  *
35  * $Id: Module.java,v 1.3 2005/10/18 13:14:50 mungady Exp $
36  *
37  * Changes
38  * -------
39  * 07-Jun-2004 : Added JCommon header (DG);
40  *
41  */

42
43 package org.jfree.base.modules;
44
45 /**
46  * A module encapsulates optional functionality within a project. Modules can
47  * be used as an easy way to make projects more configurable.
48  * <p>
49  * The module system provides a controled way to check dependencies and to initialize
50  * the modules in a controlled way.
51  *
52  * @author Thomas Morgner
53  */

54 public interface Module extends ModuleInfo
55 {
56   /**
57    * Returns an array of all required modules. If one of these modules is missing
58    * or cannot be initialized, the module itself will be not available.
59    *
60    * @return an array of the required modules.
61    */

62   public ModuleInfo[] getRequiredModules();
63
64   /**
65    * Returns an array of optional modules. Missing or invalid modules are non fatal
66    * and will not harm the module itself.
67    *
68    * @return an array of optional module specifications.
69    */

70   public ModuleInfo[] getOptionalModules();
71
72   /**
73    * Initializes the module. Use this method to perform all initial setup operations.
74    * This method is called only once in a modules lifetime. If the initializing cannot
75    * be completed, throw a ModuleInitializeException to indicate the error,. The module
76    * will not be available to the system.
77    *
78    * @param subSystem the subSystem.
79    *
80    * @throws ModuleInitializeException if an error ocurred while initializing the module.
81    */

82   public void initialize(SubSystem subSystem) throws ModuleInitializeException;
83
84   /**
85    * Configures the module. This should load the default settings of the module.
86    *
87    * @param subSystem the subSystem.
88    */

89   public void configure(SubSystem subSystem);
90
91   /**
92    * Returns a short description of the modules functionality.
93    *
94    * @return a module description.
95    */

96   public String JavaDoc getDescription();
97
98   /**
99    * Returns the name of the module producer.
100    *
101    * @return the producer name
102    */

103   public String JavaDoc getProducer();
104
105   /**
106    * Returns the module name. This name should be a short descriptive handle of the
107    * module.
108    *
109    * @return the module name
110    */

111   public String JavaDoc getName();
112
113   /**
114    * Returns the modules subsystem. If this module is not part of an subsystem
115    * then return the modules name, but never null.
116    *
117    * @return the name of the subsystem.
118    */

119   public String JavaDoc getSubSystem ();
120
121
122 }
123
Popular Tags