All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.trang.druid.actuate.DruidDataSourcePoolMetadata Maven / Gradle / Ivy

There is a newer version: 1.1.10.2
Show newest version
package com.github.trang.druid.actuate;

import org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadata;

import com.alibaba.druid.pool.DruidDataSource;

/**
 * Druid 的基础元数据
 *
 * @author trang
 */
public class DruidDataSourcePoolMetadata extends AbstractDataSourcePoolMetadata {

    public DruidDataSourcePoolMetadata(DruidDataSource dataSource) {
        super(dataSource);
    }

    @Override
    public Integer getActive() {
        return getDataSource().getActiveCount();
    }

    @Override
    public Integer getMax() {
        return getDataSource().getMaxActive();
    }

    @Override
    public Integer getMin() {
        return getDataSource().getMinIdle();
    }

    @Override
    public String getValidationQuery() {
        return getDataSource().getValidationQuery();
    }

    @Override
    public Boolean getDefaultAutoCommit() {
        return getDataSource().isDefaultAutoCommit();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy