001    /*
002     * Apache License
003     * Version 2.0, January 2004
004     * http://www.apache.org/licenses/
005     *
006     * Copyright 2008 by chenillekit.org
007     *
008     * Licensed under the Apache License, Version 2.0 (the "License");
009     * you may not use this file except in compliance with the License.
010     * You may obtain a copy of the License at
011     *
012     * http://www.apache.org/licenses/LICENSE-2.0
013     */
014    
015    package org.chenillekit.core.services;
016    
017    import javax.naming.Context;
018    import javax.sql.DataSource;
019    
020    import org.apache.commons.configuration.Configuration;
021    import org.apache.tapestry5.ioc.Resource;
022    
023    /**
024     * @version $Id: ConfigurationService.java 741 2010-11-16 15:20:59Z mlusetti $
025     * @deprecated to be removed in future release (soon)
026     */
027    @Deprecated
028    public interface ConfigurationService
029    {
030        /**
031         * get the configuration from the named resource.
032         * <p/>
033         * the system properties merged auto. into the returned configuration
034         *
035         * @param configurationResource the configuration resource
036         *
037         * @return the configuration
038         */
039        Configuration getConfiguration(Resource configurationResource);
040    
041        /**
042         * get the configuration from the named resource.
043         *
044         * @param configurationResource the configuration resource
045         * @param mergeWithSysProps     merge the configuration resource with system properties
046         *
047         * @return the configuration
048         */
049        Configuration getConfiguration(Resource configurationResource, boolean mergeWithSysProps);
050    
051        /**
052         * get the configuration from JNDI context.
053         *
054         * @param context the JNDI context
055         *
056         * @return the configuration
057         */
058        Configuration getConfiguration(Context context);
059    
060        /**
061         * get the configuration from system (JVM).
062         *
063         * @return the configuration
064         */
065        Configuration getConfiguration();
066    
067        /**
068         * Build a configuration from a table containing multiple configurations.
069         *
070         * @param datasource  the datasource to connect to the database
071         * @param table       the name of the table containing the configurations
072         * @param nameColumn  the column containing the name of the configuration
073         * @param keyColumn   the column containing the keys of the configuration
074         * @param valueColumn the column containing the values of the configuration
075         * @param name        the name of the configuration
076         */
077        Configuration getConfiguration(DataSource datasource, String table, String nameColumn,
078                                       String keyColumn, String valueColumn, String name);
079    }