gvsig-geoprocess / org.gvsig.geoprocess / trunk / org.gvsig.geoprocess / org.gvsig.geoprocess.lib / org.gvsig.geoprocess.lib.api / src / main / java / org / gvsig / geoprocess / lib / api / GeoProcessLocator.java @ 218
History | View | Annotate | Download (2.58 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 |
package org.gvsig.geoprocess.lib.api; |
23 |
|
24 |
import org.gvsig.tools.locator.BaseLocator; |
25 |
import org.gvsig.tools.locator.Locator; |
26 |
|
27 |
/**
|
28 |
* Locator to access the GeoProcess library.
|
29 |
*
|
30 |
* @author gvSIG Team
|
31 |
* @version $Id$
|
32 |
*/
|
33 |
public class GeoProcessLocator extends BaseLocator { |
34 |
|
35 |
private static final String LOCATOR_NAME = "GeoProcess.locator"; |
36 |
|
37 |
public static final String GEOPROCESS_MANAGER_NAME = "GeoProcess.manager"; |
38 |
|
39 |
public static final String GEOPROCESS_MANAGER_DESCRIPTION = |
40 |
"GeoProcess Manager";
|
41 |
|
42 |
/**
|
43 |
* Unique instance.
|
44 |
*/
|
45 |
private static final GeoProcessLocator instance = new GeoProcessLocator(); |
46 |
|
47 |
/**
|
48 |
* Return the Singleton instance.
|
49 |
*
|
50 |
* @return the Singleton instance
|
51 |
*/
|
52 |
public static GeoProcessLocator getInstance() { |
53 |
return instance;
|
54 |
} |
55 |
|
56 |
/**
|
57 |
* Return the {@link Locator}'s name.
|
58 |
*
|
59 |
* @return a String with the {@link Locator}'s name
|
60 |
*/
|
61 |
@Override
|
62 |
public String getLocatorName() { |
63 |
return LOCATOR_NAME;
|
64 |
} |
65 |
|
66 |
/**
|
67 |
* Gets the instance of the {@link GeoProcessManager} registered.
|
68 |
*
|
69 |
* @return {@link GeoProcessManager}
|
70 |
*/
|
71 |
public static GeoProcessManager getGeoProcessManager() { |
72 |
return (GeoProcessManager) getInstance().get(GEOPROCESS_MANAGER_NAME);
|
73 |
} |
74 |
|
75 |
/**
|
76 |
* Registers the Class implementing the {@link GeoProcessManager} interface.
|
77 |
*
|
78 |
* @param clazz
|
79 |
* implementing the {@link GeoProcessManager} interface
|
80 |
*/
|
81 |
public static void registerGeoProcessManager( |
82 |
Class<? extends GeoProcessManager> clazz) { |
83 |
getInstance().register(GEOPROCESS_MANAGER_NAME, |
84 |
GEOPROCESS_MANAGER_DESCRIPTION, clazz); |
85 |
} |
86 |
|
87 |
} |