KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > wminstaller > install > ModuleInstaller


1 package de.webman.wminstaller.install;
2
3 import java.util.*;
4
5 /**
6  * classes implementing this interface are acting as module installer.
7  * Installing is seperated into a number of "modules", which are worked on
8  * by seperated classes for better maintainability. A complete
9  * installation is runs in four stages: <code>pre()</code> for all modules,
10  * <code>install()</code> for all modules, <code>post()</code> for all
11  * modules, <code>configure()</code> for all modules.<p>
12  *
13  * Each Module method may throw a <code>InstallationException</code> to
14  * signal success or failure for the stage in question. The
15  * <code>InstallationException</code> has a <code>severity</code>
16  * attribute, which tells the system, that OK = action was ok, WARNING =
17  * something looks strange, but we can continue, FAILED = something failed,
18  * don't include module for later stages, FATAL = stop installation
19  * completely
20  *
21  * @author <a HREF="mailto:gregor@webman.de">Gregor Klinke</a>
22  * @version $Revision: 1.1 $
23  **/

24 public interface ModuleInstaller
25 {
26     public static final int INCLUDE = 0;
27     public static final int IGNORE = 1;
28     public static final int CONFIGURE = 2;
29
30     /* $Id: ModuleInstaller.java,v 1.1 2002/03/08 14:37:53 gregor Exp $ */
31
32     /**
33      * returns a descriptive name of the module
34      **/

35     String JavaDoc getName();
36
37     /**
38      * prepares the module for installation (verify database connections,
39      * writing access to directories, etc.)
40      * @param dictionary a dictionary containing the installation parameters
41      * @return returns one of the following values indicating what to do
42      * with this module: <code>INCLUDE</code> = install this module,
43      * <code>IGNORE</code> = don't bother about this module,
44      * <code>CONFIGURE</code> = don't install, but only configure this
45      * module. */

46     int pre(HashMap dictionary) throws InstallationException;
47     
48
49     /**
50      * installs the receiver's module (unpacks, copies, etc.)
51      * @param dictionary a dictionary containing the installation parameters
52      */

53     void install(HashMap dictionary) throws InstallationException;
54
55     /**
56      * post-fixes the receiver's module installation (setting up
57      * crossreferences, etc.)
58      * @param dictionary a dictionary containing the installation parameters */

59     void post(HashMap dictionary) throws InstallationException;
60
61     /**
62      * configures the receiver's module after installation (writing
63      * initialization files, etc.)
64      * @param dictionary a dictionary containing the installation parameters */

65     void configure(HashMap dictionary) throws InstallationException;
66     
67
68
69 }
70
Popular Tags