⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 poolmanmetricsbean.java

📁 Java Database connection pool
💻 JAVA
字号:
/* *  PoolMan Java Object Pooling and Caching Library *  Copyright (C) 1999-2001 The Code Studio * *  This library is free software; you can redistribute it and/or *  modify it under the terms of the GNU Lesser General Public *  License as published by the Free Software Foundation; either *  version 2 of the License, or (at your option) any later version. * *  This library is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *  Lesser General Public License for more details. * *  The full license is located at the root of this distribution *  in the LICENSE file. */package com.codestudio.bean.struts;import com.codestudio.util.JDBCPool;import java.io.Serializable;public class PoolManMetricsBean        implements Serializable {    protected String database;    protected int queryCount;    protected boolean usingCache;    protected String url;    protected String dbDriver;    protected String user;    protected int totalConnections;    protected int availableCons;    protected int unavailableCons;    protected long lastQueryDuration;    public PoolManMetricsBean() {        queryCount = 0;    }    public String getDatabase() {        return database;    }    public void setDatabase(String database) {        this.database = database;    }    public void incrementQueryCount() {        queryCount++;    }    public int getQueryCount() {        return queryCount;    }    public void setQueryCount(int queryCount) {        this.queryCount = queryCount;    }    public boolean isUsingCache() {        return usingCache;    }    public void setUsingCache(boolean usingCache) {        this.usingCache = usingCache;    }    public String getUrl() {        return url;    }    public void setUrl(String url) {        this.url = url;    }    public String getDbDriver() {        return dbDriver;    }    public void setDbDriver(String dbDriver) {        this.dbDriver = dbDriver;    }    public String getUser() {        return user;    }    public void setUser(String user) {        this.user = user;    }    public int getTotalConnections() {        return totalConnections;    }    public void setTotalConnections(int totalConnections) {        this.totalConnections = totalConnections;    }    public int getAvailableConnections() {        return availableCons;    }    public void setAvailableConnections(int availableCons) {        this.availableCons = availableCons;    }    public int getUnavailableConnections() {        return unavailableCons;    }    public void setUnavailableConnections(int unavailableCons) {        this.unavailableCons = unavailableCons;    }    public long getLastQueryDuration() {        return lastQueryDuration;    }    public void setLastQueryDuration(long lastQueryDuration) {        this.lastQueryDuration = lastQueryDuration;    }    public void setJDBCPool(JDBCPool pool) {        // static data set only when the selected db changes        if ((database == null) || (pool.getPoolname().equals(database))) {            setDatabase(pool.getPoolname());            setUsingCache(pool.usingCache());            setUrl(pool.getURL());            setDbDriver(pool.getDriver());            setUser(pool.getUserName());        }        // metric data set every time we're invoked        setTotalConnections(pool.numTotalObjects());        setAvailableConnections(pool.numCheckedInObjects());        setUnavailableConnections(pool.numCheckedOutObjects());    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -