gvsig-educa / org.gvsig.educa.portableview / trunk / org.gvsig.educa.portableview / org.gvsig.educa.portableview.lib / org.gvsig.educa.portableview.lib.prov.installer / src / main / java / org / gvsig / educa / portableview / lib / prov / installer / execution / PortableViewInstallerExecutionProviderFactory.java @ 403
History | View | Annotate | Download (2.47 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.educa.portableview.lib.prov.installer.execution; |
29 |
|
30 |
import org.gvsig.educa.portableview.PortableViewManager; |
31 |
import org.gvsig.tools.ToolsLocator; |
32 |
import org.gvsig.tools.dynobject.DynClass; |
33 |
import org.gvsig.tools.dynobject.DynObject; |
34 |
import org.gvsig.tools.dynobject.DynObjectManager; |
35 |
import org.gvsig.tools.service.spi.AbstractProviderFactory; |
36 |
import org.gvsig.tools.service.spi.Provider; |
37 |
import org.gvsig.tools.service.spi.ProviderServices; |
38 |
|
39 |
/**
|
40 |
* @author gvSIG Team
|
41 |
* @version $Id$
|
42 |
*
|
43 |
*/
|
44 |
public class PortableViewInstallerExecutionProviderFactory extends |
45 |
AbstractProviderFactory { |
46 |
|
47 |
public static final String PROVIDER_DESCRIPTION = |
48 |
"Portable View installation provider";
|
49 |
|
50 |
private DynClass dynclass;
|
51 |
|
52 |
@Override
|
53 |
protected DynClass createParametersDynClass() {
|
54 |
if (dynclass == null) { |
55 |
initialize(); |
56 |
} |
57 |
return dynclass;
|
58 |
} |
59 |
|
60 |
@Override
|
61 |
protected Provider doCreate(DynObject parameters, ProviderServices services) { |
62 |
return new PortableViewInstallerExecutionProvider(services); |
63 |
} |
64 |
|
65 |
@Override
|
66 |
public String getName() { |
67 |
return PortableViewManager.INSTALLER_PROVIDER_NAME;
|
68 |
} |
69 |
|
70 |
|
71 |
public void initialize() { |
72 |
if (dynclass == null) { |
73 |
DynObjectManager dynObjectManager = |
74 |
ToolsLocator.getDynObjectManager(); |
75 |
dynclass = |
76 |
dynObjectManager.createDynClass(this.getName(),
|
77 |
PROVIDER_DESCRIPTION); |
78 |
dynObjectManager.add(dynclass); |
79 |
} |
80 |
} |
81 |
|
82 |
} |