Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java @ 171:7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
gnv-artifacts/trunk@208 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 09 Oct 2009 07:54:48 +0000 |
parents | bb45c5097cb6 |
children | b5e55f460f0b |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Fri Oct 09 07:49:47 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Fri Oct 09 07:54:48 2009 +0000 @@ -21,20 +21,20 @@ /** * @author Tim Englich <tim.englich@intevation.de> - * + * */ public class GNVArtifactContextFactory implements ArtifactContextFactory { /** * the logger, used to log exceptions and additonaly information */ private static Logger log = Logger.getLogger(GNVArtifactContext.class); - - public static final String XPATH_GEOBACKEND_CONFIGURATION= "artifact-database/geo-backend/backend-configuration"; - - public static final String XPATH_GEOBACKEND_QUERYCONFIGURATION= "artifact-database/geo-backend/query-configuration"; - + + public static final String XPATH_GEOBACKEND_CONFIGURATION = "artifact-database/geo-backend/backend-configuration"; + + public static final String XPATH_GEOBACKEND_QUERYCONFIGURATION = "artifact-database/geo-backend/query-configuration"; + private final static String CACHECONFIGNODEPATH = "/artifact-database/ehcache/configuration"; - + /** * Constructor */ @@ -51,30 +51,32 @@ try { log.debug("GNVArtifactContextFactory.createArtifactContext"); log.info("Initialisation of the Geo-BackendConnectionPool"); - String backendConfigurationFile = Config.getStringXPath(config, XPATH_GEOBACKEND_CONFIGURATION); + String backendConfigurationFile = Config.getStringXPath(config, + XPATH_GEOBACKEND_CONFIGURATION); Properties properties = getProperties(backendConfigurationFile); ConnectionPoolFactory cpf = ConnectionPoolFactory.getInstance(); cpf.initializeConnectionPool(properties); - + log.info("Initialisation of the QueryContainer"); - String queryConfigurationFile = Config.getStringXPath(config, XPATH_GEOBACKEND_QUERYCONFIGURATION); + String queryConfigurationFile = Config.getStringXPath(config, + XPATH_GEOBACKEND_QUERYCONFIGURATION); Properties queryProperties = getProperties(queryConfigurationFile); QueryContainerFactory qcf = QueryContainerFactory.getInstance(); qcf.initializeQueryContainer(queryProperties); - - + log.info("Initialisation of the Cache"); - String cacheConfigurationFile = Config.getStringXPath(config, CACHECONFIGNODEPATH); + String cacheConfigurationFile = Config.getStringXPath(config, + CACHECONFIGNODEPATH); CacheFactory cf = CacheFactory.getInstance(); cf.initializeCache(cacheConfigurationFile); - + returnValue = new GNVArtifactContext(config); } catch (FileNotFoundException e) { - log.error(e,e); + log.error(e, e); } catch (IOException e) { - log.error(e,e); - } catch (QueryContainerException e){ - log.error(e,e); + log.error(e, e); + } catch (QueryContainerException e) { + log.error(e, e); } return returnValue; } @@ -86,7 +88,8 @@ * @throws IOException */ private Properties getProperties(String filePath) - throws FileNotFoundException, IOException { + throws FileNotFoundException, + IOException { InputStream inputStream = new FileInputStream(filePath); Properties properties = new Properties(); properties.load(inputStream);