亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? attributerestoringconnectioninvocationhandler.java

?? Java中非常實用流控制工具
?? JAVA
字號:
/* 
 * Copyright 2004-2006 OpenSymphony 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 * use this file except in compliance with the License. You may obtain a copy 
 * of the License at 
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0 
 *   
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
 * License for the specific language governing permissions and limitations 
 * under the License.
 */
package org.quartz.impl.jdbcjobstore;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * <p>
 * Protects a <code>{@link java.sql.Connection}</code>'s attributes from being permanently modfied.
 * </p>
 * 
 * <p>
 * Wraps a provided <code>{@link java.sql.Connection}</code> such that its auto 
 * commit and transaction isolation attributes can be overwritten, but 
 * will automatically restored to their original values when the connection
 * is actually closed (and potentially returned to a pool for reuse).
 * </p>
 * 
 * @see org.quartz.impl.jdbcjobstore.JobStoreSupport#getConnection()
 * @see org.quartz.impl.jdbcjobstore.JobStoreCMT#getNonManagedTXConnection()
 */
public class AttributeRestoringConnectionInvocationHandler implements InvocationHandler {
    private Connection conn;
    
    private boolean overwroteOriginalAutoCommitValue;
    private boolean overwroteOriginalTxIsolationValue;

    // Set if overwroteOriginalAutoCommitValue is true
    private boolean originalAutoCommitValue; 

    // Set if overwroteOriginalTxIsolationValue is true
    private int originalTxIsolationValue;
    
    public AttributeRestoringConnectionInvocationHandler(
        Connection conn) {
        this.conn = conn;
    }

    protected Log getLog() {
        return LogFactory.getLog(getClass());
    }
    
    public Object invoke(Object proxy, Method method, Object[] args)
        throws Throwable {
        if (method.getName().equals("setAutoCommit")) {
            setAutoCommit(((Boolean)args[0]).booleanValue());
        } else if (method.getName().equals("setTransactionIsolation")) {
            setTransactionIsolation(((Integer)args[0]).intValue());
        } else if (method.getName().equals("close")) {
            close();
        } else {
            return method.invoke(conn, args);
        }
        
        return null;
    }
     
    /**
     * Sets this connection's auto-commit mode to the given state, saving
     * the original mode.  The connection's original auto commit mode is restored
     * when the connection is closed.
     */
    public void setAutoCommit(boolean autoCommit) throws SQLException {
        boolean currentAutoCommitValue = conn.getAutoCommit();
            
        if (autoCommit != currentAutoCommitValue) {
            if (overwroteOriginalAutoCommitValue == false) {
                overwroteOriginalAutoCommitValue = true;
                originalAutoCommitValue = currentAutoCommitValue;
            }
            
            conn.setAutoCommit(autoCommit);
        }
    }

    /**
     * Attempts to change the transaction isolation level to the given level, saving
     * the original level.  The connection's original transaction isolation level is 
     * restored when the connection is closed.
     */
    public void setTransactionIsolation(int level) throws SQLException {
        int currentLevel = conn.getTransactionIsolation();
        
        if (level != currentLevel) {
            if (overwroteOriginalTxIsolationValue == false) {
                overwroteOriginalTxIsolationValue = true;
                originalTxIsolationValue = currentLevel;
            }
            
            conn.setTransactionIsolation(level);
        }
    }
    
    /**
     * Gets the underlying connection to which all operations ultimately 
     * defer.  This is provided in case a user ever needs to punch through 
     * the wrapper to access vendor specific methods outside of the 
     * standard <code>java.sql.Connection</code> interface.
     * 
     * @return The underlying connection to which all operations
     * ultimately defer.
     */
    public Connection getWrappedConnection() {
        return conn;
    }

    /**
     * Attempts to restore the auto commit and transaction isolation connection
     * attributes of the wrapped connection to their original values (if they
     * were overwritten).
     */
    public void restoreOriginalAtributes() {
        try {
            if (overwroteOriginalAutoCommitValue) {
                conn.setAutoCommit(originalAutoCommitValue);
            }
        } catch (Throwable t) {
            getLog().warn("Failed restore connection's original auto commit setting.", t);
        }
        
        try {    
            if (overwroteOriginalTxIsolationValue) {
                conn.setTransactionIsolation(originalTxIsolationValue);
            }
        } catch (Throwable t) {
            getLog().warn("Failed restore connection's original transaction isolation setting.", t);
        }
    }
    
    /**
     * Attempts to restore the auto commit and transaction isolation connection
     * attributes of the wrapped connection to their original values (if they
     * were overwritten), before finally actually closing the wrapped connection.
     */
    public void close() throws SQLException {
        restoreOriginalAtributes();
        
        conn.close();
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲第一电影网| 一区二区三区四区中文字幕| 偷拍一区二区三区四区| 成熟亚洲日本毛茸茸凸凹| 91精品视频网| 亚洲老司机在线| 国产成+人+日韩+欧美+亚洲| 日韩欧美亚洲国产精品字幕久久久| 亚洲人成伊人成综合网小说| 国产精品一区免费视频| 日韩女同互慰一区二区| 亚洲福利一二三区| 色噜噜狠狠色综合中国| 中文字幕在线不卡视频| 国产精品影音先锋| 欧美va亚洲va香蕉在线| 91麻豆产精品久久久久久| 久久久无码精品亚洲日韩按摩| 欧美国产在线观看| 国产精品一区二区三区四区 | 午夜精品一区二区三区电影天堂| av在线播放成人| 中文字幕精品一区| 国产成人在线观看免费网站| 精品久久久久久久久久久久包黑料| 日韩国产欧美在线观看| 欧美偷拍一区二区| 亚洲午夜精品久久久久久久久| 97久久精品人人澡人人爽| 国产精品毛片久久久久久久| 国产精品一区不卡| 国产喂奶挤奶一区二区三区| 国产一区欧美一区| 久久嫩草精品久久久精品| 国产一区二区三区在线观看免费 | 成人网男人的天堂| 国产欧美日韩综合精品一区二区| 国产精品乡下勾搭老头1| 精品国产伦一区二区三区观看体验| 青草国产精品久久久久久| 欧美一区二区精美| 老司机免费视频一区二区三区| 欧美一区二区大片| 久久99热国产| 久久综合九色综合97婷婷女人 | 精品一区二区三区免费观看| 日韩三级视频在线观看| 蜜臀精品一区二区三区在线观看| 欧美一区二区三区在线看| 麻豆精品国产传媒mv男同| 欧美mv和日韩mv的网站| 国产精品性做久久久久久| 亚洲国产精品黑人久久久| voyeur盗摄精品| 一区二区三区中文字幕精品精品| 欧美亚洲日本国产| 视频一区视频二区中文| 欧美电影在哪看比较好| 精品写真视频在线观看| 久久久久久免费| av一区二区三区在线| 亚洲摸摸操操av| 欧美精品丝袜中出| 91超碰这里只有精品国产| 欧美性受xxxx黑人xyx| 国产成人av影院| 男人的j进女人的j一区| 日本欧美在线看| 青青草伊人久久| 精品一区二区三区在线播放视频| 久久不见久久见免费视频1| 裸体健美xxxx欧美裸体表演| 狠狠色狠狠色合久久伊人| 成人黄色av电影| 国内精品久久久久影院一蜜桃| 国产区在线观看成人精品| 国产午夜精品在线观看| 91在线精品秘密一区二区| 亚洲一区在线视频观看| 欧美一级视频精品观看| 国产成人一区二区精品非洲| 亚洲精品欧美激情| 欧美大片日本大片免费观看| 成人性生交大合| 亚洲一区在线免费观看| 91精品国产综合久久香蕉的特点 | 555www色欧美视频| av欧美精品.com| 婷婷久久综合九色国产成人 | 色婷婷久久一区二区三区麻豆| 亚洲成年人网站在线观看| 欧美精品一区二区三区视频| 91片在线免费观看| 一本大道av伊人久久综合| 日韩激情在线观看| 中文字幕综合网| 日韩欧美资源站| 色嗨嗨av一区二区三区| 国产综合一区二区| 亚洲成人动漫在线观看| 中文字幕免费观看一区| 欧美顶级少妇做爰| 99精品视频一区| 韩国三级中文字幕hd久久精品| 亚洲免费观看高清完整版在线观看熊| 日韩欧美高清一区| 欧美三级乱人伦电影| 高清视频一区二区| 久久国产生活片100| 一区二区激情小说| 国产欧美日韩精品在线| 日韩一区国产二区欧美三区| 91免费视频网| 国产精品一区二区黑丝| 日韩高清中文字幕一区| 亚洲欧美怡红院| 国产婷婷色一区二区三区四区| 欧美伦理影视网| 91福利精品第一导航| 精品成人一区二区| 伊人色综合久久天天| 国产精品一区一区| 蜜桃久久av一区| 精品久久久久香蕉网| 久久国产精品99精品国产| 欧美成人a在线| 久久66热偷产精品| 久久精品在线免费观看| 国产一区二区三区黄视频| 久久影院午夜论| 狠狠色狠狠色综合| 综合亚洲深深色噜噜狠狠网站| 91啪在线观看| 成人小视频免费观看| 黄色精品一二区| 麻豆国产精品官网| 视频一区二区中文字幕| 亚洲h精品动漫在线观看| 一区二区高清视频在线观看| 亚洲柠檬福利资源导航| 中文字幕乱码一区二区免费| 久久久久久久综合| 久久综合av免费| 欧美成人vr18sexvr| 日韩精品在线看片z| 欧美一级搡bbbb搡bbbb| 91精品婷婷国产综合久久性色| 911精品国产一区二区在线| 欧美人狂配大交3d怪物一区| 日韩精品三区四区| 久久精品无码一区二区三区| 色噜噜夜夜夜综合网| 91丨porny丨蝌蚪视频| 9i在线看片成人免费| 成人av电影免费观看| 99re热这里只有精品免费视频| 成人高清视频免费观看| 99久久精品国产麻豆演员表| 99久久精品免费看| 日本韩国一区二区三区| 欧美三级中文字幕| 欧美高清一级片在线| 欧美一级二级三级乱码| 日韩欧美一级精品久久| 欧美成人国产一区二区| 久久久久久亚洲综合影院红桃| 国产欧美视频一区二区| 自拍偷拍亚洲激情| 亚洲曰韩产成在线| 日精品一区二区| 久久国产麻豆精品| 国产乱人伦精品一区二区在线观看 | 亚洲福利视频导航| 日韩主播视频在线| 久久国产精品露脸对白| 国产夫妻精品视频| 99久久99精品久久久久久| 色爱区综合激月婷婷| 欧美福利视频导航| 欧美精品一区二区三区一线天视频| 久久蜜桃av一区精品变态类天堂| 国产三级欧美三级日产三级99 | 日韩一区二区三区三四区视频在线观看 | 国产精品99久久久久| 波多野结衣精品在线| 在线观看中文字幕不卡| 91精品国产色综合久久不卡蜜臀 | 欧美性做爰猛烈叫床潮| 91精品国产一区二区人妖| 久久精品夜夜夜夜久久| 综合久久久久久| 三级成人在线视频| 国产在线精品国自产拍免费| fc2成人免费人成在线观看播放| 精品视频在线免费观看| 精品sm在线观看| 亚洲免费在线播放| 久久99精品久久久久久久久久久久 | 麻豆久久一区二区| 99久久精品国产网站|