gvsig-raster / org.gvsig.raster.tools / trunk / templates / rasterTaskProjectTemplate / alg_template / sources / libapi / ProjectTemplateLocator.java @ 1843
History | View | Annotate | Download (2 KB)
1 |
package org.gvsig.raster.projecttemplate.lib; |
---|---|
2 |
|
3 |
import org.gvsig.tools.locator.BaseLocator; |
4 |
import org.gvsig.tools.locator.Locator; |
5 |
import org.gvsig.tools.locator.LocatorException; |
6 |
|
7 |
/**
|
8 |
* This locator is the entry point for the Raster library, providing
|
9 |
* access to all Raster services through the {@link ProjectTemplateManager}
|
10 |
* .
|
11 |
*
|
12 |
* @author gvSIG team
|
13 |
* @version $Id$
|
14 |
*/
|
15 |
public class ProjectTemplateLocator extends BaseLocator { |
16 |
public static final String MANAGER_NAME = "ProjectTemplate.manager"; |
17 |
public static final String MANAGER_DESCRIPTION = "ProjectTemplate Manager"; |
18 |
private static final String LOCATOR_NAME = "ProjectTemplate.locator"; |
19 |
private static final ProjectTemplateLocator INSTANCE = new ProjectTemplateLocator(); |
20 |
|
21 |
/**
|
22 |
* Return the singleton instance.
|
23 |
*
|
24 |
* @return the singleton instance
|
25 |
*/
|
26 |
public static ProjectTemplateLocator getInstance() { |
27 |
return INSTANCE;
|
28 |
} |
29 |
|
30 |
/**
|
31 |
* Return the Locator's name.
|
32 |
*
|
33 |
* @return a String with the Locator's name
|
34 |
*/
|
35 |
public final String getLocatorName() { |
36 |
return LOCATOR_NAME;
|
37 |
} |
38 |
|
39 |
/**
|
40 |
* Return a reference to the ProjectTemplateManager.
|
41 |
*
|
42 |
* @return a reference to the ProjectTemplateManager
|
43 |
* @throws LocatorException
|
44 |
* if there is no access to the class or the class cannot be
|
45 |
* instantiated
|
46 |
* @see Locator#get(String)
|
47 |
*/
|
48 |
public static ProjectTemplateManager getManager() throws LocatorException { |
49 |
return (ProjectTemplateManager) getInstance().get(MANAGER_NAME);
|
50 |
} |
51 |
|
52 |
/**
|
53 |
* Registers the Class implementing the RasterManager interface.
|
54 |
*
|
55 |
* @param clazz
|
56 |
* implementing the RasterManager interface
|
57 |
*/
|
58 |
public static void registerManager( |
59 |
Class<? extends ProjectTemplateManager> clazz) { |
60 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
61 |
} |
62 |
|
63 |
} |