deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.crs.configuration
Class CRSConfiguration

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

public class CRSConfiguration
extends java.lang.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 java.util.Map<java.lang.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(java.lang.String providerName)
          Creates or returns an instance of the CRSConfiguration by trying to instantiate the given provider class.
 CRSProvider getProvider()
           
static void main(java.lang.String[] args)
          export the given file to the deegree-crs format.
static java.lang.String setDefaultFileProperty(java.lang.String fileName)
          Overwrites the crs.configuration property with the given value.
 java.lang.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 java.util.Map<java.lang.String,CRSConfiguration> DEFINED_CONFIGURATIONS
public so servlets can clear it, to avoid memory leaks...

Method Detail

getCRSConfiguration

public static CRSConfiguration getCRSConfiguration(java.lang.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 java.lang.String setDefaultFileProperty(java.lang.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(java.lang.String[] args)
                 throws java.lang.Exception
export the given file to the deegree-crs format.

Parameters:
args -
Throws:
java.lang.Exception

getProvider

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

deegree 2.5 (2011/06/29 09:44 build-8-official)

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