deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.crs.configuration
Class CRSConfiguration

java.lang.Object
  extended by org.deegree.crs.configuration.CRSConfiguration

public class CRSConfiguration
extends Object

The CRSConfiguration creates, instantiates and supplies a configured CRS-Provider. Because only one crs-configuration is needed inside the JVM, this implementation uses a singleton pattern.

The configuration will try to read the file: crs_providers.properties. It uses following strategie to load this file, first the root directory (e.g. '/' or WEB-INF/classes ) will be searched. If no file was found there, it will try to load from the package. The properties file must denote a property with name 'CRS_PROVIDER' followed by a '=' and a fully qualified name denoting the class (an instance of CRSProvider) which should be available in the classpath. This class must have an empty constructor.

Version:
$Revision: 18308 $, $Date: 2009-07-02 14:40:19 +0200 (Do, 02. Jul 2009) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Field Summary
static Map<String,CRSConfiguration> DEFINED_CONFIGURATIONS
          public so servlets can clear it, to avoid memory leaks...
 
Method Summary
static CRSConfiguration getCRSConfiguration()
          Creates or returns an instance of the CRSConfiguration by reading the DEFAULT property configured in the 'crs_providers.properties'.
static CRSConfiguration getCRSConfiguration(String providerName)
          Creates or returns an instance of the CRSConfiguration by trying to instantiate the given provider class.
 CRSProvider getProvider()
           
static void main(String[] args)
          export the given file to the deegree-crs format.
static String setDefaultFileProperty(String fileName)
          Overwrites the crs.configuration property with the given value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFINED_CONFIGURATIONS

public static final Map<String,CRSConfiguration> DEFINED_CONFIGURATIONS
public so servlets can clear it, to avoid memory leaks...

Method Detail

getCRSConfiguration

public static CRSConfiguration getCRSConfiguration(String providerName)
Creates or returns an instance of the CRSConfiguration by trying to instantiate the given provider class. If the name is null or "" the Provider configured in the 'crs_providers.properties' will be returned. If the instantiation of this class fails a DeegreeCRSProvider will be returned.

Parameters:
providerName - the canonical name of the class, e.g. org.deegree.crs.MyProvider
Returns:
an instance of a CRS-Configuration with the configured CRSProvider.
Throws:
CRSConfigurationException - if --anything-- went wrong while instantiating the CRSProvider.

getCRSConfiguration

public static CRSConfiguration getCRSConfiguration()
                                            throws CRSConfigurationException
Creates or returns an instance of the CRSConfiguration by reading the DEFAULT property configured in the 'crs_providers.properties'. If no key is given (or no string could be loaded), the DeegreeCRSProvider will be used.

Returns:
an instance of a CRS-Configuration with the configured CRSProvider.
Throws:
CRSConfigurationException - if --anything-- went wrong while instantiating the CRSProvider.

setDefaultFileProperty

public static String setDefaultFileProperty(String fileName)
Overwrites the crs.configuration property with the given value.

Parameters:
fileName - to set the crs.configuration property to.
Returns:
the old crs.configuration propert (if any)
Throws:
CRSConfigurationException - if --anything-- went wrong while instantiating the CRSProvider.

main

public static void main(String[] args)
                 throws Exception
export the given file to the deegree-crs format.

Parameters:
args -
Throws:
Exception

getProvider

public final CRSProvider getProvider()
Returns:
the crs provider.

toString

public String toString()
Overrides:
toString in class Object

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org