Mercurial > dive4elements > gnv-client
view geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainerFactory.java @ 887:b757def3ff55
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
geo-backend/trunk@859 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 29 Mar 2010 09:45:05 +0000 |
parents | 8b442223741c |
children | a277ebde74e4 |
line wrap: on
line source
package de.intevation.gnv.geobackend.base.query.container; import de.intevation.gnv.geobackend.base.query.container.exception.QueryContainerException; import java.util.Properties; import org.apache.log4j.Logger; /** * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ public class QueryContainerFactory { /** * the logger, used to log exceptions and additonaly information */ private static Logger log = Logger.getLogger(QueryContainerFactory.class); /** * The singleton Instance of this Factory. */ private static QueryContainerFactory instance = null; /** * The ConnectionPool providing the Connections to the DatabaseBackends */ private QueryContainer queryContainer = null; /** * Basic-Constructor of this Class */ private QueryContainerFactory() { super(); } /** * This Method provides an singleton Instance of this Class. * @return an singleton Instance of this Class */ public static synchronized QueryContainerFactory getInstance(){ if (instance == null){ instance = new QueryContainerFactory(); } return instance; } /** * Getting the QueryContainer * @return the QueryContainer */ public QueryContainer getQueryContainer(){ return this.queryContainer; } /** * Initializes the QueryContainer. * Should only be called once on system startup * @param properties the Properties for the Individual Configuration of the QueryContainerbb * @throws QueryContainerException */ public synchronized void initializeQueryContainer(Properties properties) throws QueryContainerException{ log.debug("ConnectionPoolFactory.initializeConnectionPool"); if (this.queryContainer == null){ this.queryContainer = new DefaultQueryContainer(); this.queryContainer.initialize(properties); }else{ log.warn("ConnectionPool already initialized"); } } /** * Checks if the QueryContainer has already been initialized. * @return true if the QueryContainer is initialized. */ public boolean isInitialized(){ return this.queryContainer != null; } }