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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? offlineconnection.java

?? 一個java方面的消息訂閱發(fā)送的源碼
?? 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) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人妖av一区二区| 国产日产欧美一区| 91女神在线视频| av网站一区二区三区| 懂色av一区二区三区蜜臀| 国产一区二区三区日韩| 国产主播一区二区| 国产成人在线视频网站| 成人综合婷婷国产精品久久 | 香蕉加勒比综合久久| 亚洲男人天堂一区| 一区二区欧美国产| 天堂蜜桃91精品| 婷婷开心激情综合| 极品少妇xxxx精品少妇偷拍| 国产精一品亚洲二区在线视频| 国产精品一区二区久久不卡| 色婷婷香蕉在线一区二区| 色噜噜久久综合| 91麻豆精品国产91久久久使用方法 | 欧美猛男超大videosgay| 欧美区在线观看| 久久久久亚洲综合| 一区二区三区在线看| 午夜天堂影视香蕉久久| 精品一区二区三区免费观看| www.成人在线| 7777精品伊人久久久大香线蕉经典版下载 | 国产91清纯白嫩初高中在线观看 | 91精品国产综合久久精品app| 欧美一区二区三区视频| 亚洲国产中文字幕在线视频综合| 青青草国产精品97视觉盛宴| 国产一区二区免费看| 91精品办公室少妇高潮对白| 日韩一区二区三区四区| 综合色中文字幕| 老司机精品视频线观看86 | 99re视频这里只有精品| 欧美久久久久免费| 中文字幕不卡的av| 蜜桃av一区二区| 91免费看`日韩一区二区| 精品国产一二三| 亚洲曰韩产成在线| 成人午夜精品一区二区三区| 91精品国产综合久久精品图片| 国产精品久久国产精麻豆99网站| 日韩成人一级大片| 日本高清不卡一区| 国产日韩欧美精品一区| 日本最新不卡在线| 欧美视频在线一区二区三区| 欧美国产激情二区三区| 极品销魂美女一区二区三区| 欧美欧美欧美欧美| 亚洲日穴在线视频| 成人免费观看男女羞羞视频| 日韩免费性生活视频播放| 午夜激情综合网| 91黄色免费观看| 亚洲黄色在线视频| 91在线看国产| 中文字幕一区二区在线播放| 国产乱码字幕精品高清av | 中文字幕一区二区三区在线观看 | 一区二区高清视频在线观看| 国产成a人亚洲精| 久久综合久久99| 久久疯狂做爰流白浆xx| 日韩欧美国产一二三区| 婷婷国产在线综合| 91精品欧美一区二区三区综合在| 亚洲午夜日本在线观看| 日本道免费精品一区二区三区| 日韩一区欧美一区| 94-欧美-setu| 亚洲男女一区二区三区| 91视频观看免费| 洋洋av久久久久久久一区| 欧美三区在线视频| 午夜电影一区二区| 欧美成人女星排名| 国产成人精品一区二| 欧美韩日一区二区三区| 欧美精品一区二| 国产精品123| 日韩一区有码在线| 欧美性一二三区| 日韩成人av影视| 精品国产91久久久久久久妲己 | 欧美日韩亚洲综合在线| 亚洲午夜激情av| 欧美一级搡bbbb搡bbbb| 国产在线日韩欧美| 国产精品美女视频| 色狠狠色狠狠综合| 奇米亚洲午夜久久精品| 久久精品欧美一区二区三区不卡| 北条麻妃一区二区三区| 亚洲一区二区视频| 精品福利av导航| thepron国产精品| 日韩福利电影在线| 国产精品久久久久影院色老大| 欧美三级乱人伦电影| 久久国产精品无码网站| 亚洲欧洲日韩在线| 日韩视频123| 91在线观看美女| 久久精品72免费观看| 亚洲视频综合在线| 日韩欧美在线观看一区二区三区| 成人激情动漫在线观看| 亚洲sss视频在线视频| 欧美韩日一区二区三区| 欧美高清视频不卡网| jlzzjlzz亚洲日本少妇| 蜜桃视频在线观看一区二区| 亚洲视频在线一区| 久久色中文字幕| 欧美日本乱大交xxxxx| 不卡的av电影在线观看| 久久精品久久99精品久久| 最新日韩在线视频| 久久久不卡影院| 欧美肥妇free| 色偷偷88欧美精品久久久 | 免费观看在线色综合| 国产精品区一区二区三区| 精品国产91久久久久久久妲己| 在线观看三级视频欧美| 岛国一区二区在线观看| 久久国产综合精品| 日韩福利视频导航| 五月天一区二区| 亚洲精品国产a| 国产精品美女久久福利网站| 欧美tk—视频vk| 日韩午夜精品电影| 欧美老年两性高潮| 欧美日韩一区久久| 在线视频你懂得一区二区三区| av中文一区二区三区| 成人丝袜高跟foot| 成人av动漫在线| 成人开心网精品视频| 国产91精品一区二区麻豆网站| 国模套图日韩精品一区二区| 裸体一区二区三区| 久久精品国产99国产| 久久av老司机精品网站导航| 麻豆91在线播放免费| 久久er99热精品一区二区| 久久99精品国产.久久久久久| 日本欧美一区二区三区| 麻豆专区一区二区三区四区五区| 喷白浆一区二区| 国产一区二区久久| 成人免费高清视频| 91麻豆成人久久精品二区三区| 91国内精品野花午夜精品| 色综合一区二区| 欧美视频在线观看一区| 91麻豆精品国产| www国产精品av| 国产精品久久久久久久蜜臀| 18成人在线视频| 国产成人夜色高潮福利影视| 国产宾馆实践打屁股91| 成人av小说网| 欧美在线观看视频一区二区| 91精品国产91久久久久久最新毛片| 欧美本精品男人aⅴ天堂| 中文字幕免费不卡| 亚洲在线一区二区三区| 日本成人在线视频网站| 丁香激情综合五月| 欧美日韩mp4| 久久影院电视剧免费观看| 亚洲欧洲日韩一区二区三区| 亚洲电影视频在线| 极品美女销魂一区二区三区| 99久久婷婷国产精品综合| 欧美日韩国产高清一区二区三区 | 在线视频欧美精品| 日韩一级二级三级| 国产精品久久久久天堂| 亚洲成av人片一区二区梦乃| 国产成人综合在线播放| 欧美色男人天堂| 国产亚洲一区二区三区四区 | 不卡一区中文字幕| 欧美精选一区二区| 中文字幕第一区第二区| 丝袜国产日韩另类美女| 91丝袜美腿高跟国产极品老师| 欧美日韩国产成人在线免费| 中文字幕av免费专区久久| 全国精品久久少妇|