List of usage examples for javax.sql DataSource getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:org.yx.db.conn.ConnectionFactory.java
public Map<String, Map<String, Integer>> status() { Set<DataSource> set = new HashSet<>(); set.addAll(this.read.allDataSource()); set.addAll(this.write.allDataSource()); Map<String, Map<String, Integer>> statusMap = new HashMap<>(); for (DataSource datasource : set) { if (!BasicDataSource.class.isInstance(datasource)) { Log.get(this.getClass(), 25345).info("ds.class({}) is not instance form BasicDataSource", datasource.getClass().getName()); continue; }//from www .j ava 2 s. c om @SuppressWarnings("resource") BasicDataSource ds = (BasicDataSource) datasource; Map<String, Integer> map = new HashMap<>(); map.put("active", ds.getNumActive()); map.put("idle", ds.getNumIdle()); map.put("minIdle", ds.getMinIdle()); map.put("maxIdle", ds.getMaxIdle()); map.put("maxTotal", ds.getMaxTotal()); statusMap.put(ds.toString(), map); } return statusMap; }