svn-gvsig-desktop / branches / v2_0_0_prep / extensions / org.gvsig.installer / org.gvsig.installer.lib / org.gvsig.installer.lib.api / src / main / java / org / gvsig / installer / lib / api / InstallerManager.java @ 32585
History | View | Annotate | Download (4.86 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2010 {Prodevelop} {Task}
|
26 |
*/
|
27 |
|
28 |
package org.gvsig.installer.lib.api; |
29 |
|
30 |
import java.io.File; |
31 |
|
32 |
import org.gvsig.installer.lib.api.creation.MakePluginPackageService; |
33 |
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException; |
34 |
import org.gvsig.installer.lib.api.execution.InstallPackageService; |
35 |
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException; |
36 |
import org.gvsig.tools.service.Manager; |
37 |
|
38 |
/**
|
39 |
* <p>
|
40 |
* This manager is used to register and create the services that are used
|
41 |
* to manage the creation and the execution of installers. An installer is
|
42 |
* a file called <b>bundle</b> that is composed of a set <b>packages</b>.
|
43 |
* </p>
|
44 |
* <p>
|
45 |
* A package has some information that is defined by the {@link PackageInfo}
|
46 |
* class and is composed of a set of attributes. One of these attributes,
|
47 |
* the type, denotes if the package is a plugin, theme, translation, etc.
|
48 |
* </p>
|
49 |
* <p>
|
50 |
* In practice a bundle is just a compressed zip file that has a compressed zip file
|
51 |
* for every package to install. The structure of a bundle file with two
|
52 |
* packages of type plugin could be:
|
53 |
* </p>
|
54 |
* <pre>
|
55 |
* - bundle (compressed file)
|
56 |
* - org.gvsig.plugin1-1_0_0-23 (compressed file)
|
57 |
* - org.gvsig.plugin1
|
58 |
* - package.info
|
59 |
* - org.gvsig.plugin2-2_0_1-35 (compressed file)
|
60 |
* - org.gvsig.plugin1
|
61 |
* - package.info
|
62 |
* </pre>
|
63 |
* <p>
|
64 |
* bundle is the compressed file that contains a zip entry for every
|
65 |
* package to install. The name of the zip entry follows next pattern:
|
66 |
* </p>
|
67 |
* <pre>
|
68 |
* [package code]-[version]-[build]
|
69 |
* </pre>
|
70 |
* <p>
|
71 |
* Every zip entry contains a main folder inside that contains all the
|
72 |
* package files that are used in the installation process. Depending of the
|
73 |
* type of packages, the information inside this folder can be different,
|
74 |
* but all the types of packages have to have the <b>package.info</b> that
|
75 |
* has all the package information. To see the <b>package.info</b> description
|
76 |
* see {@link PackageInfo}.
|
77 |
* <p>
|
78 |
* </p>
|
79 |
* The services that offers this managers are basically two: the creation of
|
80 |
* bundles for just one package of type plugin and a service for the
|
81 |
* installation of packages.
|
82 |
* service.
|
83 |
* </p>
|
84 |
*
|
85 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a>
|
86 |
*/
|
87 |
public interface InstallerManager extends Manager { |
88 |
|
89 |
/**
|
90 |
* It registers a class that implements the service for the creation of
|
91 |
* installers. It has to implement the {@link MakePluginPackageService} interface.
|
92 |
*
|
93 |
* @param clazz
|
94 |
* Class that implements the {@link MakePluginPackageService} interface.
|
95 |
*/
|
96 |
@SuppressWarnings(value = "unchecked") |
97 |
public void registerMakePluginPackageService(Class clazz); |
98 |
|
99 |
/**
|
100 |
* It creates and returns an object that is used to create an installer for
|
101 |
* a selected plugin. All the parameters are set using the {@link MakePluginPackageService}
|
102 |
* interface.
|
103 |
*
|
104 |
* @return
|
105 |
* An object that is used to create a plugin installer
|
106 |
* @throws MakePluginPackageServiceException
|
107 |
* When there is a problem creating the service
|
108 |
*/
|
109 |
public MakePluginPackageService getMakePluginPackageService(File pluginsDirectory) throws MakePluginPackageServiceException; |
110 |
|
111 |
/**
|
112 |
* It registers a class that implements the service for the execution of
|
113 |
* installers. It has to implement the {@link InstallPackageService} interface.
|
114 |
*
|
115 |
* @param clazz
|
116 |
* Class that implements the {@link InstallPackageService} interface.
|
117 |
*/
|
118 |
@SuppressWarnings("unchecked") |
119 |
public void registerInstallPackageService(Class clazz); |
120 |
|
121 |
/**
|
122 |
* It creates and returns an object that is used to execute an installer for
|
123 |
* the installation of plugins in gvSIG. All the parameters are set using the
|
124 |
* {@link InstallPackageService} interface.
|
125 |
*
|
126 |
* @return
|
127 |
* An object that is used to install the installer file
|
128 |
* @throws InstallPackageServiceException
|
129 |
* When there is a problem creating the service
|
130 |
*/
|
131 |
public InstallPackageService getInstallPackageService() throws InstallPackageServiceException; |
132 |
} |
133 |
|