Module.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. package org.jfree.base.modules;
  43. /**
  44. * A module encapsulates optional functionality within a project. Modules can
  45. * be used as an easy way to make projects more configurable.
  46. * <p>
  47. * The module system provides a controled way to check dependencies and to initialize
  48. * the modules in a controlled way.
  49. *
  50. * @author Thomas Morgner
  51. */
  52. public interface Module extends ModuleInfo
  53. {
  54. /**
  55. * Returns an array of all required modules. If one of these modules is missing
  56. * or cannot be initialized, the module itself will be not available.
  57. *
  58. * @return an array of the required modules.
  59. */
  60. public ModuleInfo[] getRequiredModules();
  61. /**
  62. * Returns an array of optional modules. Missing or invalid modules are non fatal
  63. * and will not harm the module itself.
  64. *
  65. * @return an array of optional module specifications.
  66. */
  67. public ModuleInfo[] getOptionalModules();
  68. /**
  69. * Initializes the module. Use this method to perform all initial setup operations.
  70. * This method is called only once in a modules lifetime. If the initializing cannot
  71. * be completed, throw a ModuleInitializeException to indicate the error,. The module
  72. * will not be available to the system.
  73. *
  74. * @param subSystem the subSystem.
  75. *
  76. * @throws ModuleInitializeException if an error ocurred while initializing the module.
  77. */
  78. public void initialize(SubSystem subSystem) throws ModuleInitializeException;
  79. /**
  80. * Configures the module. This should load the default settings of the module.
  81. *
  82. * @param subSystem the subSystem.
  83. */
  84. public void configure(SubSystem subSystem);
  85. /**
  86. * Returns a short description of the modules functionality.
  87. *
  88. * @return a module description.
  89. */
  90. public String getDescription();
  91. /**
  92. * Returns the name of the module producer.
  93. *
  94. * @return the producer name
  95. */
  96. public String getProducer();
  97. /**
  98. * Returns the module name. This name should be a short descriptive handle of the
  99. * module.
  100. *
  101. * @return the module name
  102. */
  103. public String getName();
  104. /**
  105. * Returns the modules subsystem. If this module is not part of an subsystem
  106. * then return the modules name, but never null.
  107. *
  108. * @return the name of the subsystem.
  109. */
  110. public String getSubSystem ();
  111. }