Search in sources :

Example 16 with DataSourceProxyImpl

use of com.alibaba.druid.proxy.jdbc.DataSourceProxyImpl in project druid by alibaba.

the class JdbcStatManager method getDataSourceList.

@Override
public TabularData getDataSourceList() throws JMException {
    CompositeType rowType = getDataSourceCompositeType();
    String[] indexNames = rowType.keySet().toArray(new String[rowType.keySet().size()]);
    TabularType tabularType = new TabularType("DataSourceStat", "DataSourceStat", rowType, indexNames);
    TabularData data = new TabularDataSupport(tabularType);
    {
        final ConcurrentMap<String, DataSourceProxyImpl> dataSources = DruidDriver.getProxyDataSources();
        for (DataSourceProxyImpl dataSource : dataSources.values()) {
            data.put(dataSource.getCompositeData());
        }
    }
    final Set<DruidDataSource> dataSources = DruidDataSourceStatManager.getDruidDataSourceInstances();
    for (DruidDataSource dataSource : dataSources) {
        data.put(dataSource.getCompositeData());
    }
    return data;
}
Also used : DataSourceProxyImpl(com.alibaba.druid.proxy.jdbc.DataSourceProxyImpl) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType) ConcurrentMap(java.util.concurrent.ConcurrentMap) DruidDataSource(com.alibaba.druid.pool.DruidDataSource) CompositeType(javax.management.openmbean.CompositeType) TabularData(javax.management.openmbean.TabularData)

Aggregations

DataSourceProxyImpl (com.alibaba.druid.proxy.jdbc.DataSourceProxyImpl)16 DataSourceProxyConfig (com.alibaba.druid.proxy.jdbc.DataSourceProxyConfig)10 Properties (java.util.Properties)6 MockDriver (com.alibaba.druid.mock.MockDriver)5 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)5 Log4jFilter (com.alibaba.druid.filter.logging.Log4jFilter)4 ConnectionProxyImpl (com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl)4 DataSourceProxy (com.alibaba.druid.proxy.jdbc.DataSourceProxy)4 FilterChain (com.alibaba.druid.filter.FilterChain)3 FilterChainImpl (com.alibaba.druid.filter.FilterChainImpl)3 FilterEventAdapter (com.alibaba.druid.filter.FilterEventAdapter)3 CommonsLogFilter (com.alibaba.druid.filter.logging.CommonsLogFilter)3 StatFilter (com.alibaba.druid.filter.stat.StatFilter)3 ConnectionProxy (com.alibaba.druid.proxy.jdbc.ConnectionProxy)3 ResultSetProxy (com.alibaba.druid.proxy.jdbc.ResultSetProxy)3 SQLException (java.sql.SQLException)3 Statement (java.sql.Statement)3 ConcurrentMap (java.util.concurrent.ConcurrentMap)3 CompositeType (javax.management.openmbean.CompositeType)3 TabularData (javax.management.openmbean.TabularData)3