01: package de.webman.wminstaller.install;
02:
03: import java.util.*;
04:
05: /**
06: * classes implementing this interface are acting as module installer.
07: * Installing is seperated into a number of "modules", which are worked on
08: * by seperated classes for better maintainability. A complete
09: * 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: public static final int INCLUDE = 0;
26: public static final int IGNORE = 1;
27: public static final int CONFIGURE = 2;
28:
29: /* $Id: ModuleInstaller.java,v 1.1 2002/03/08 14:37:53 gregor Exp $ */
30:
31: /**
32: * returns a descriptive name of the module
33: **/
34: String getName();
35:
36: /**
37: * prepares the module for installation (verify database connections,
38: * writing access to directories, etc.)
39: * @param dictionary a dictionary containing the installation parameters
40: * @return returns one of the following values indicating what to do
41: * with this module: <code>INCLUDE</code> = install this module,
42: * <code>IGNORE</code> = don't bother about this module,
43: * <code>CONFIGURE</code> = don't install, but only configure this
44: * module. */
45: int pre(HashMap dictionary) throws InstallationException;
46:
47: /**
48: * installs the receiver's module (unpacks, copies, etc.)
49: * @param dictionary a dictionary containing the installation parameters
50: */
51: void install(HashMap dictionary) throws InstallationException;
52:
53: /**
54: * post-fixes the receiver's module installation (setting up
55: * crossreferences, etc.)
56: * @param dictionary a dictionary containing the installation parameters */
57: void post(HashMap dictionary) throws InstallationException;
58:
59: /**
60: * configures the receiver's module after installation (writing
61: * initialization files, etc.)
62: * @param dictionary a dictionary containing the installation parameters */
63: void configure(HashMap dictionary) throws InstallationException;
64:
65: }
|