001: /* ========================================================================
002: * JCommon : a free general purpose class library for the Java(tm) platform
003: * ========================================================================
004: *
005: * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
006: *
007: * Project Info: http://www.jfree.org/jcommon/index.html
008: *
009: * This library is free software; you can redistribute it and/or modify it
010: * under the terms of the GNU Lesser General Public License as published by
011: * the Free Software Foundation; either version 2.1 of the License, or
012: * (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful, but
015: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
016: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
017: * License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
022: * USA.
023: *
024: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
025: * in the United States and other countries.]
026: *
027: * -----------
028: * Module.java
029: * -----------
030: * (C)opyright 2004, by Thomas Morgner and Contributors.
031: *
032: * Original Author: Thomas Morgner;
033: * Contributor(s): David Gilbert (for Object Refinery Limited);
034: *
035: * $Id: Module.java,v 1.3 2005/10/18 13:14:50 mungady Exp $
036: *
037: * Changes
038: * -------
039: * 07-Jun-2004 : Added JCommon header (DG);
040: *
041: */
042:
043: package org.jfree.base.modules;
044:
045: /**
046: * A module encapsulates optional functionality within a project. Modules can
047: * be used as an easy way to make projects more configurable.
048: * <p>
049: * The module system provides a controled way to check dependencies and to initialize
050: * the modules in a controlled way.
051: *
052: * @author Thomas Morgner
053: */
054: public interface Module extends ModuleInfo {
055: /**
056: * Returns an array of all required modules. If one of these modules is missing
057: * or cannot be initialized, the module itself will be not available.
058: *
059: * @return an array of the required modules.
060: */
061: public ModuleInfo[] getRequiredModules();
062:
063: /**
064: * Returns an array of optional modules. Missing or invalid modules are non fatal
065: * and will not harm the module itself.
066: *
067: * @return an array of optional module specifications.
068: */
069: public ModuleInfo[] getOptionalModules();
070:
071: /**
072: * Initializes the module. Use this method to perform all initial setup operations.
073: * This method is called only once in a modules lifetime. If the initializing cannot
074: * be completed, throw a ModuleInitializeException to indicate the error,. The module
075: * will not be available to the system.
076: *
077: * @param subSystem the subSystem.
078: *
079: * @throws ModuleInitializeException if an error ocurred while initializing the module.
080: */
081: public void initialize(SubSystem subSystem)
082: throws ModuleInitializeException;
083:
084: /**
085: * Configures the module. This should load the default settings of the module.
086: *
087: * @param subSystem the subSystem.
088: */
089: public void configure(SubSystem subSystem);
090:
091: /**
092: * Returns a short description of the modules functionality.
093: *
094: * @return a module description.
095: */
096: public String getDescription();
097:
098: /**
099: * Returns the name of the module producer.
100: *
101: * @return the producer name
102: */
103: public String 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 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 getSubSystem();
120:
121: }
|