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

📄 objectpoolservice.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.management;import com.codestudio.util.PoolMetaData;import javax.management.MBeanRegistration;import javax.management.MBeanServer;import javax.management.NotificationBroadcasterSupport;import javax.management.ObjectName;/** * An MBean defining the manageable attributes of a JDBCPool * and PoolManDataSource. Upon any change after being registered, * it sends a Notification to all NotificationListsners. The * SQLManagerListener will be such a listener, and will allow * PoolMan properties to be changed while a pool is live; it * will merely remove the pool (as long as the name doesn't change) * and add it again. The listener can also delete a pool altogether. */public abstract class ObjectPoolService extends NotificationBroadcasterSupport implements ObjectPoolServiceMBean, MBeanRegistration {    protected MBeanServer server;    protected boolean available = false;    protected PoolMetaData metadata;    public ObjectPoolService() {        this.metadata = new PoolMetaData();    }    /* JMX REGISTRATION METHODS */    public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception {        this.server = server;        return name;    }    public void postRegister(Boolean b) {    }    public void preDeregister() throws Exception {    }    public void postDeregister() {    }    /* ACTION METHODS */    public abstract void start() throws Exception;    public abstract void stop() throws Exception;    public boolean isRunning() {        return this.available;    }    /* POOL ID METHODS */    public String getName() {        return this.metadata.getName();    }    public void setName(String name) {        this.metadata.setName(name);    }    /* POOL PROPERTY METHODS */    public int getInitialObjects() {        return this.metadata.getInitialObjects();    }    public void setInitialObjects(int n) {        this.metadata.setInitialObjects(n);    }    public int getMinimumSize() {        return this.metadata.getMinimumSize();    }    public void setMinimumSize(int n) {        this.metadata.setMinimumSize(n);    }    public int getMaximumSize() {        return this.metadata.getMaximumSize();    }    public void setMaximumSize(int n) {        this.metadata.setMaximumSize(n);    }    public int getObjectTimeout() {        return this.metadata.getObjectTimeout();    }    public void setObjectTimeout(int n) {        this.metadata.setObjectTimeout(n);    }    public int getUserTimeout() {        return this.metadata.getUserTimeout();    }    public void setUserTimeout(int n) {        this.metadata.setUserTimeout(n);    }    public int getSkimmerFrequency() {        return this.metadata.getSkimmerFrequency();    }    public void setSkimmerFrequency(int n) {        this.metadata.setSkimmerFrequency(n);    }    public int getShrinkBy() {        return this.metadata.getShrinkBy();    }    public void setShrinkBy(int n) {        this.metadata.setShrinkBy(n);    }    public boolean isMaximumSoft() {        return this.metadata.isMaximumSoft();    }    public void setMaximumSoft(boolean b) {        this.metadata.setMaximumSoft(b);    }    public String getLogFile() {        return this.metadata.getLogFile();    }    public void setLogFile(String filename) {        this.metadata.setLogFile(filename);    }    public boolean isDebugging() {        return this.metadata.isDebugging();    }    public void setDebugging(boolean b) {        this.metadata.setDebugging(b);    }}

⌨️ 快捷键说明

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