Statistics
| Revision:

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 @ 237

History | View | Annotate | Download (2.5 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007,2012 gvSIG Association.
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
package org.gvsig.geoprocess.lib.api;
22

    
23
import org.gvsig.tools.locator.BaseLocator;
24
import org.gvsig.tools.locator.Locator;
25

    
26
/**
27
 * Locator to access the GeoProcess library.
28
 * 
29
 * @author gvSIG Team
30
 * @version $Id$
31
 */
32
public class GeoProcessLocator extends BaseLocator {
33

    
34
    private static final String LOCATOR_NAME = "GeoProcess.locator";
35

    
36
    public static final String GEOPROCESS_MANAGER_NAME = "GeoProcess.manager";
37

    
38
    public static final String GEOPROCESS_MANAGER_DESCRIPTION =
39
        "GeoProcess Manager";
40

    
41
    /**
42
     * Unique instance.
43
     */
44
    private static final GeoProcessLocator instance = new GeoProcessLocator();
45

    
46
    /**
47
     * Return the Singleton instance.
48
     * 
49
     * @return the Singleton instance
50
     */
51
    public static GeoProcessLocator getInstance() {
52
        return instance;
53
    }
54

    
55
    /**
56
     * Return the {@link Locator}'s name.
57
     * 
58
     * @return a String with the {@link Locator}'s name
59
     */
60
    @Override
61
    public String getLocatorName() {
62
        return LOCATOR_NAME;
63
    }
64

    
65
    /**
66
     * Gets the instance of the {@link GeoProcessManager} registered.
67
     * 
68
     * @return {@link GeoProcessManager}
69
     */
70
    public static GeoProcessManager getGeoProcessManager() {
71
        return (GeoProcessManager) getInstance().get(GEOPROCESS_MANAGER_NAME);
72
    }
73

    
74
    /**
75
     * Registers the Class implementing the {@link GeoProcessManager} interface.
76
     * 
77
     * @param clazz
78
     *            implementing the {@link GeoProcessManager} interface
79
     */
80
    public static void registerGeoProcessManager(
81
        Class<? extends GeoProcessManager> clazz) {
82
        getInstance().register(GEOPROCESS_MANAGER_NAME,
83
            GEOPROCESS_MANAGER_DESCRIPTION, clazz);
84
    }
85

    
86
}