// Path: jdbi/src/main/java/com/ning/jetty/jdbi/config/DaoConfig.java
// public interface DaoConfig
// {
//     @Description("The jdbc url for the database")
//     @Config("com.ning.jetty.jdbi.url")
//     @Default("jdbc:mysql://127.0.0.1:3306/information_schema")
//     String getJdbcUrl();
// 
//     @Description("The jdbc user name for the database")
//     @Config("com.ning.jetty.jdbi.user")
//     @Default("root")
//     String getUsername();
// 
//     @Description("The jdbc password for the database")
//     @Config("com.ning.jetty.jdbi.password")
//     @Default("root")
//     String getPassword();
// 
//     @Description("The minimum allowed number of idle connections to the database")
//     @Config("com.ning.jetty.jdbi.minIdle")
//     @Default("1")
//     int getMinIdle();
// 
//     @Description("The maximum allowed number of active connections to the database")
//     @Config("com.ning.jetty.jdbi.maxActive")
//     @Default("10")
//     int getMaxActive();
// 
//     @Description("How long to wait before a connection attempt to the database is considered timed out")
//     @Config("com.ning.jetty.jdbi.connectionTimeout")
//     @Default("10s")
//     TimeSpan getConnectionTimeout();
// 
//     @Description("The time for a connection to remain unused before it is closed off")
//     @Config("com.ning.jetty.jdbi.idleMaxAge")
//     @Default("60m")
//     TimeSpan getIdleMaxAge();
// 
//     @Description("Any connections older than this setting will be closed off whether it is idle or not. Connections " +
//             "currently in use will not be affected until they are returned to the pool")
//     @Config("com.ning.jetty.jdbi.maxConnectionAge")
//     @Default("0m")
//     TimeSpan getMaxConnectionAge();
// 
//     @Description("Time for a connection to remain idle before sending a test query to the DB")
//     @Config("com.ning.jetty.jdbi.idleConnectionTestPeriod")
//     @Default("5m")
//     TimeSpan getIdleConnectionTestPeriod();
// 
//     @Description("Log level for SQL queries")
//     @Config("com.ning.jetty.jdbi.logLevel")
//     @Default("DEBUG")
//     LogLevel getLogLevel();
// }


import java.util.concurrent.TimeUnit;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.TimingCollector;
import org.skife.jdbi.v2.tweak.SQLLog;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.jolbox.bonecp.BoneCPConfig;
import com.jolbox.bonecp.BoneCPDataSource;
import com.ning.jetty.jdbi.config.DaoConfig;
import com.yammer.metrics.core.MetricsRegistry;
import com.yammer.metrics.jdbi.InstrumentedTimingCollector;
import com.yammer.metrics.jdbi.strategies.BasicSqlNameStrategy;
/*
 * Copyright 2010-2011 Ning, Inc.
 *
 * Ning licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package com.ning.jetty.jdbi.guice.providers;




public class DBIProvider implements Provider<DBI> {
    private final MetricsRegistry metricsRegistry;
// Path: jdbi/src/main/java/com/ning/jetty/jdbi/config/DaoConfig.java
// public interface DaoConfig
// {
//     @Description("The jdbc url for the database")
//     @Config("com.ning.jetty.jdbi.url")
//     @Default("jdbc:mysql://127.0.0.1:3306/information_schema")
//     String getJdbcUrl();
// 
//     @Description("The jdbc user name for the database")
//     @Config("com.ning.jetty.jdbi.user")
//     @Default("root")
//     String getUsername();
// 
//     @Description("The jdbc password for the database")
//     @Config("com.ning.jetty.jdbi.password")
//     @Default("root")
//     String getPassword();
// 
//     @Description("The minimum allowed number of idle connections to the database")
//     @Config("com.ning.jetty.jdbi.minIdle")
//     @Default("1")
//     int getMinIdle();
// 
//     @Description("The maximum allowed number of active connections to the database")
//     @Config("com.ning.jetty.jdbi.maxActive")
//     @Default("10")
//     int getMaxActive();
// 
//     @Description("How long to wait before a connection attempt to the database is considered timed out")
//     @Config("com.ning.jetty.jdbi.connectionTimeout")
//     @Default("10s")
//     TimeSpan getConnectionTimeout();
// 
//     @Description("The time for a connection to remain unused before it is closed off")
//     @Config("com.ning.jetty.jdbi.idleMaxAge")
//     @Default("60m")
//     TimeSpan getIdleMaxAge();
// 
//     @Description("Any connections older than this setting will be closed off whether it is idle or not. Connections " +
//             "currently in use will not be affected until they are returned to the pool")
//     @Config("com.ning.jetty.jdbi.maxConnectionAge")
//     @Default("0m")
//     TimeSpan getMaxConnectionAge();
// 
//     @Description("Time for a connection to remain idle before sending a test query to the DB")
//     @Config("com.ning.jetty.jdbi.idleConnectionTestPeriod")
//     @Default("5m")
//     TimeSpan getIdleConnectionTestPeriod();
// 
//     @Description("Log level for SQL queries")
//     @Config("com.ning.jetty.jdbi.logLevel")
//     @Default("DEBUG")
//     LogLevel getLogLevel();
// }


// Path: jdbi/src/main/java/com/ning/jetty/jdbi/guice/providers/DBIProvider.java
import java.util.concurrent.TimeUnit;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.TimingCollector;
import org.skife.jdbi.v2.tweak.SQLLog;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.jolbox.bonecp.BoneCPConfig;
import com.jolbox.bonecp.BoneCPDataSource;
import com.ning.jetty.jdbi.config.DaoConfig;
import com.yammer.metrics.core.MetricsRegistry;
import com.yammer.metrics.jdbi.InstrumentedTimingCollector;
import com.yammer.metrics.jdbi.strategies.BasicSqlNameStrategy;

/*
 * Copyright 2010-2011 Ning, Inc.
 *
 * Ning licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package com.ning.jetty.jdbi.guice.providers;




public class DBIProvider implements Provider<DBI> {
    private final MetricsRegistry metricsRegistry;
    private final DaoConfig config;