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

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

?? offlineconnection.java

?? 一個java方面的消息訂閱發送的源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/**
 * Redistribution and use of this software and associated documentation
 * ("Software"), with or without modification, are permitted provided
 * that the following conditions are met:
 *
 * 1. Redistributions of source code must retain copyright
 *    statements and notices.  Redistributions must also contain a
 *    copy of this document.
 *
 * 2. Redistributions in binary form must reproduce the
 *    above copyright notice, this list of conditions and the
 *    following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. The name "Exolab" must not be used to endorse or promote
 *    products derived from this Software without prior written
 *    permission of Exoffice Technologies.  For written permission,
 *    please contact info@exolab.org.
 *
 * 4. Products derived from this Software may not be called "Exolab"
 *    nor may "Exolab" appear in their names without prior written
 *    permission of Exoffice Technologies. Exolab is a registered
 *    trademark of Exoffice Technologies.
 *
 * 5. Due credit should be given to the Exolab Project
 *    (http://www.exolab.org/).
 *
 * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
 * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Copyright 2000,2003 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: OfflineConnection.java,v 1.1 2004/11/26 01:51:15 tanderson Exp $
 *
 * Date         Author  Changes
 * $Date	    jimm    Created
 */


package org.exolab.jms.tools.admin;

import java.awt.Component;
import java.sql.Connection;
import java.util.Enumeration;
import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.transaction.TransactionManager;

import org.exolab.jms.authentication.User;
import org.exolab.jms.client.JmsDestination;
import org.exolab.jms.client.JmsQueue;
import org.exolab.jms.client.JmsTopic;
import org.exolab.jms.config.Configuration;
import org.exolab.jms.config.ConfigurationManager;
import org.exolab.jms.config.DatabaseConfiguration;
import org.exolab.jms.persistence.DatabaseService;
import org.exolab.jms.persistence.PersistenceException;


/**
 * Connect directly to the Persistent store to retrieve information and perfrom
 * updates.
 *
 * <P> Note: If the OpenJMSServer is active, this connection will fail, since
 * it requires and exclusive lock on the database to avoid database corruption.
 * Similarly, if this connection is active the OpenJMSServer cannot be started
 * for the same reasons.
 *
 * @version     $Revision: 1.1 $ $Date: 2004/11/26 01:51:15 $
 * @author      <a href="mailto:mourikis@exolab.org">Jim Mourikis</a>
 * @see		AbstractAdminConnection
 * @see		AdminMgr
 */
public class OfflineConnection extends AbstractAdminConnection {

    // The parent Gui
    private Component _parent;

    // The deafult JNDI context.
    private Context _context = null;

    /**
     * Connect to the RMIAdmin Server if in online mode, or open
     * the database and update the data directly in offline mode.
     *
     * @param online Indicates if we are connecting in online or offline mode.
     * @param parent The component parent.
     * @throws IllegalStateException if {@link ConfigurationManager} has not
     * been initialised
     * @throws OfflineConnectionException When the database cannot be opened
     */
    public OfflineConnection(Component parent)
        throws OfflineConnectionException {
        try {
            if (_instance == null) {
                _parent = parent;

                Configuration config = ConfigurationManager.getConfig();

                DatabaseConfiguration dbconfig =
                    config.getDatabaseConfiguration();

                // determine the database type and instantiate the appropriate
                // database adapter
                if (dbconfig.getRdbmsDatabaseConfiguration() != null) {
                    DatabaseService.instance().getAdapter();
                    _instance = this;
                } else {
                    JFileChooser chooser = new JFileChooser(".");
                    chooser.setDialogTitle
                        ("Select OpenJMS Database to connect to");
                    chooser.setFileFilter(new DatabaseFilter());
                    int returnVal = chooser.showOpenDialog(parent);

                    if (returnVal == JFileChooser.APPROVE_OPTION) {
                        DatabaseService.instance().getAdapter();
                        _instance = this;
                    }
                }
            } else {
                throw new org.exolab.jms.tools.admin.OfflineConnectionException("Already connected");
            }
        } catch (Exception err) {
            throw new org.exolab.jms.tools.admin.OfflineConnectionException
                ("Database Error: " + err.getMessage());
        }
    }

    // implementation of AbstractAdminConnection.close
    public void close() {
        DatabaseService.getAdapter().close();
        _instance = null;
    }

    // implementation of AbstractAdminConnection.addDurableConsumer
    public boolean addDurableConsumer(String topic, String name) {
        boolean result = false;
        Connection connection = null;

        try {
            connection = DatabaseService.getConnection();
            DatabaseService.getAdapter().addDurableConsumer(connection, topic,
                name);
            connection.commit();
            result = true;

        } catch (PersistenceException exception) {
            try {
                connection.rollback();
            } catch (Exception nested) {
                // ignore
            }
        } catch (Exception exception) {
            // ignore for the moment
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (Exception nested) {
                    // ignore
                }
            }
        }

        return result;
    }

    // implementation of AbstractAdminConnection.removeDurableConsumer
    public boolean removeDurableConsumer(String name) {
        boolean result = false;
        Connection connection = null;

        try {
            connection = DatabaseService.getConnection();

            DatabaseService.getAdapter().removeDurableConsumer(connection, name);
            connection.commit();
            result = true;

        } catch (PersistenceException exception) {
            try {
                connection.rollback();
            } catch (Exception nested) {
                // ignore
            }
        } catch (Exception exception) {
            // ignore for the moment
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (Exception nested) {
                    // ignore
                }
            }
        }

        return result;
    }

    // implementation of AbstractAdminConnection.unregisterConsumer
    public boolean unregisterConsumer(String name) {
        return false;
    }

    // implementation of AbstractAdminConnection.isConnected
    public boolean isConnected(String name) {
        return false;
    }

    // implementation of AbstractAdminConnection.getAllDestinations
    public Enumeration getAllDestinations() {
        Enumeration result = null;
        Connection connection = null;

        try {
            connection = DatabaseService.getConnection();

            result = DatabaseService.getAdapter().getAllDestinations(
                connection);
            connection.commit();
        } catch (PersistenceException exception) {
            try {
                connection.rollback();
            } catch (Exception nested) {
                // ignore
            }
        } catch (Exception exception) {
            // ignore for the moment
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (Exception nested) {
                    // ignore
                }
            }
        }

        return result;
    }

    // implementation of AbstractAdminConnection.addDestination
    public boolean addDestination(String destination, boolean isQueue) {
        Connection connection = null;
        boolean success = false;

        try {
            connection = DatabaseService.getConnection();

            DatabaseService.getAdapter().addDestination(connection,
                destination, isQueue);
            if (_context == null) {
                // connect to the JNDI server and get a reference to
                // root context
                Hashtable props = new Hashtable();
                props.put(Context.INITIAL_CONTEXT_FACTORY,
                    "org.exolab.jms.jndi.intravm.IntravmJndiServer");
                _context = new InitialContext(props);
            }

            Object ob = (isQueue ? (Object) (new JmsQueue(destination)) :
                (Object) (new JmsTopic(destination)));

            if (ob instanceof JmsQueue) {
                ((JmsDestination) ob).setPersistent(true);
            }

            _context.rebind(destination, ob);
            connection.commit();
            success = true;
        } catch (PersistenceException exception) {
            System.err.println("Failed to add destination " + destination +
                " b/c " + exception.toString());
            try {
                connection.rollback();
            } catch (Exception nested) {
                // ignore
            }
        } catch (javax.naming.NamingException err) {
            System.err.println("Failed to add " + destination +
                " in JNDI context");
            try {
                connection.rollback();
            } catch (Exception nested) {
                // ignore
            }
        } catch (Exception exception) {
            // ignore for the moment
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (Exception nested) {
                    // ignore
                }
            }
        }

        return success;
    }

    // implementation of AbstractAdminConnection.getDurableConsumerMessageCount
    public int getDurableConsumerMessageCount(String topic, String name) {
        int count = -1;
        Connection connection = null;

        try {
            connection = DatabaseService.getConnection();

            count = DatabaseService.getAdapter().getDurableConsumerMessageCount(
                connection, topic, name);
            connection.commit();
        } catch (PersistenceException exception) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲成av人在线观看导航| 国产乱码精品一区二区三区av | 欧美日韩高清不卡| 久久久久综合网| 午夜精品免费在线| 99精品偷自拍| 欧美国产日韩a欧美在线观看| 日韩av中文在线观看| 99久久免费国产| 国产精品天美传媒| 九九**精品视频免费播放| 在线播放亚洲一区| 日韩久久一区二区| 成人免费视频caoporn| 日韩欧美专区在线| 午夜不卡av在线| 欧美亚州韩日在线看免费版国语版| 久久久久亚洲综合| 国产麻豆精品theporn| 日韩视频免费观看高清完整版在线观看| 亚洲男人天堂一区| 成人av网在线| 亚洲色图一区二区三区| jiyouzz国产精品久久| 国产亚洲精品久| 国产.欧美.日韩| 国产午夜一区二区三区| 国产一区二区三区四区五区美女| 欧美一区二区成人6969| 蜜臂av日日欢夜夜爽一区| 欧美理论片在线| 日韩成人午夜电影| 日韩三级免费观看| 国内成人自拍视频| 久久久av毛片精品| 国产91精品一区二区麻豆网站| 久久久久国产成人精品亚洲午夜| 国产在线视频不卡二| 久久男人中文字幕资源站| 国产盗摄一区二区| 国产精品久久久99| 91国产免费看| 丝瓜av网站精品一区二区| 欧美成人一级视频| 成人免费精品视频| 亚洲三级在线播放| 91.com在线观看| 久久99精品久久久久久国产越南| 欧美va亚洲va在线观看蝴蝶网| 激情欧美日韩一区二区| 国产三级三级三级精品8ⅰ区| 丁香婷婷综合网| 有码一区二区三区| 日韩欧美亚洲另类制服综合在线| 精品一区二区三区免费视频| 久久九九全国免费| 欧美性一二三区| 蜜桃一区二区三区在线观看| 久久久久久久久久久久久女国产乱| 不卡欧美aaaaa| 午夜视黄欧洲亚洲| 久久美女艺术照精彩视频福利播放| 成人综合激情网| 亚洲成人福利片| 国产午夜精品美女毛片视频| 91九色最新地址| 九九国产精品视频| 一区二区三区欧美在线观看| 精品欧美久久久| 一本大道av伊人久久综合| 免费欧美日韩国产三级电影| 亚洲欧洲精品一区二区精品久久久| 欧美日韩亚洲综合在线 | 欧美日韩大陆在线| 国产精品18久久久久久久久| 亚洲综合成人网| 久久久精品日韩欧美| 欧美羞羞免费网站| 不卡视频在线看| 久久国产精品99久久久久久老狼| 亚洲免费在线看| 久久精品视频一区二区三区| 欧美日韩国产一区| av在线一区二区| 国产一区二区精品在线观看| 三级欧美在线一区| 一区二区三国产精华液| 国产女人aaa级久久久级 | 欧美亚洲国产一卡| 国产成a人无v码亚洲福利| 免费观看30秒视频久久| 亚洲在线一区二区三区| 国产精品久久久久久久久免费桃花| 精品国产精品网麻豆系列| 欧美三级欧美一级| 91极品视觉盛宴| 色综合网色综合| 成人综合婷婷国产精品久久免费| 久久99热99| 日本不卡1234视频| 视频精品一区二区| 午夜不卡av在线| 亚洲国产成人91porn| 一区二区在线观看不卡| 国产精品三级在线观看| 精品福利在线导航| 日韩欧美国产电影| 欧美电影免费观看高清完整版在| 欧美日韩一级片网站| 欧美日韩三级在线| 欧美浪妇xxxx高跟鞋交| 在线中文字幕一区| 在线观看免费一区| 欧美日韩中文字幕一区| 91久久线看在观草草青青| 久久综合九色综合欧美98| 欧美一区二区三区在| 日韩一级完整毛片| 精品国产乱码久久久久久蜜臀 | 亚洲综合网站在线观看| 一区二区三区美女视频| 一区二区免费视频| 亚洲成人你懂的| 免费不卡在线观看| 激情图片小说一区| 国产福利一区二区三区| 成人免费福利片| 91丨porny丨中文| 欧美三级午夜理伦三级中视频| 欧美亚洲愉拍一区二区| 欧美日韩国产影片| 精品国产三级电影在线观看| 国产精品午夜在线| 亚洲一区二区精品久久av| 日日夜夜一区二区| 国产精品77777| 91蝌蚪porny九色| 欧美日韩1234| 精品福利一区二区三区免费视频| 国产精品全国免费观看高清| 亚洲精品一二三| 日韩成人精品在线观看| 国产成人综合在线| 欧美午夜精品久久久久久超碰| 日韩欧美一区二区视频| 国产日韩欧美激情| 亚洲第一激情av| 国产成人福利片| 欧美日韩高清在线| 国产精品美女久久久久aⅴ| 亚洲国产欧美在线| 成人免费看片app下载| 欧美精品在线观看一区二区| 久久九九久精品国产免费直播| 一区二区久久久久| 国产精品91一区二区| 欧美色图一区二区三区| 久久久五月婷婷| 日韩精品乱码av一区二区| 成人动漫在线一区| 欧美一区二区不卡视频| 亚洲欧美另类久久久精品2019| 开心九九激情九九欧美日韩精美视频电影 | 国产精品综合二区| 欧美日韩在线不卡| 国产精品乱码一区二区三区软件| 男女男精品视频网| 欧亚洲嫩模精品一区三区| 国产欧美日韩在线| 蜜桃av一区二区| 欧美美女网站色| 曰韩精品一区二区| 成人av在线网| 国产调教视频一区| 蜜臀精品久久久久久蜜臀| 91久久精品一区二区三区| 国产精品麻豆99久久久久久| 精品在线观看免费| 欧美日韩国产一区二区三区地区| 自拍偷拍亚洲激情| 国产suv精品一区二区6| 精品国内二区三区| 日产国产高清一区二区三区| 91视频.com| 椎名由奈av一区二区三区| 粉嫩欧美一区二区三区高清影视| 欧美www视频| 毛片av一区二区三区| 制服.丝袜.亚洲.中文.综合| 亚洲成在人线在线播放| 色狠狠av一区二区三区| 日韩一区在线免费观看| www..com久久爱| 国产精品免费av| www.欧美色图| 成人免费小视频| 91丨九色丨蝌蚪富婆spa| 国产精品久久久久久久久快鸭| 丁香激情综合国产| 亚洲视频免费看|