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

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

?? resourcemanager.java

?? 一個java方面的消息訂閱發送的源碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
     * Ask the resource manager to prepare for a transaction commit of the
     * transaction specified in xid
     *
     * @param xares
     * @return int - XA_RDONLY or XA_OK
     * @throws XAException - if there is a problem completing the call
     */
    public synchronized boolean isSameRM(XAResource xares)
        throws XAException {
        boolean result = false;

        if ((xares == this) ||
            ((xares instanceof ResourceManager) &&
            (((ResourceManager) xares)._rid.equals(_rid)))) {
            result = true;
        }

        return result;
    }

    /**
     * Obtain a list of prepared transaction branches from a resource manager.
     * The transaction manager calls this method during recovery to obtain the
     * list of transaction branches that are currently in prepared or
     * heuristically completed states.
     *
     * @throws XAException - if there is a problem completing the call
     */
    public synchronized int prepare(Xid id)
        throws XAException {
        //check the xid is not null
        if (id == null) {
            throw new XAException(XAException.XAER_NOTA);
        }

        // covert to our internal representation of an xid
        ExternalXid xid = new ExternalXid(id);

        // check to see that the xid actually exists
        if (!isTransactionActive(xid)) {
            throw new XAException(XAException.XAER_PROTO);
        }

        // can a prepare for the same resource occur multiple times
        // ????

        try {
            logTransactionState(xid, TransactionState.PREPARED);
        } catch (Exception exception) {
            throw new XAException("Error processing prepare : " + exception);
        }

        return XAResource.XA_OK;
    }

    /**
     * Inform the resource manager to roll back work done on behalf of a
     * transaction branch
     *
     * @throws XAException - if there is a problem completing the call
     */
    public synchronized Xid[] recover(int flag)
        throws XAException {

        Xid[] result = new Xid[0];

        if ((flag == XAResource.TMNOFLAGS) ||
            (flag == XAResource.TMSTARTRSCAN) ||
            (flag == XAResource.TMENDRSCAN)) {
            LinkedList xids = new LinkedList();
            Iterator iter = _activeTransactions.keySet().iterator();
            while (iter.hasNext()) {
                Xid xid = (Xid) iter.next();
                LinkedList list = (LinkedList) _activeTransactions.get(xid);
                if (list.size() > 1) {
                    // need at least a start in the chain.
                    Object last = list.getLast();
                    if ((last instanceof StateTransactionLogEntry) &&
                        (((StateTransactionLogEntry) last).getState().isPrepared())) {
                        xids.add(xid);
                    }
                }

            }
            result = (Xid[]) xids.toArray();
        }

        return result;
    }

    /**
     * Set the current transaction timeout value for this XAResource instance.
     *
     * @throws XAException - if there is a problem completing the call
     */
    public synchronized void rollback(Xid id)
        throws XAException {
        //check the xid is not null
        if (id == null) {
            throw new XAException(XAException.XAER_NOTA);
        }

        // covert to our internal representation of an xid
        ExternalXid xid = new ExternalXid(id);

        // check to see that the xid actually exists
        if (!isTransactionActive(xid)) {
            throw new XAException(XAException.XAER_PROTO);
        }

        // process the data in that transaction. If it was a published message
        // then drop it. If it was a consumed message then return it back to
        // the destination.
        Connection connection = null;
        try {
            // get a connection to the database
            connection = DatabaseService.getConnection();

            // retrieve a list of recrods for the specified global transaction
            // and process them. Ignore the state records and only process the
            // data records, which are of type TransacitonalObjectWrapper.
            Object[] records = getTransactionRecords(xid, _rid);
            for (int index = 0; index < records.length; index++) {
                if (records[index] instanceof TransactionalObjectWrapper) {
                    TransactionalObjectWrapper wrapper =
                        (TransactionalObjectWrapper) records[index];
                    if (wrapper.isPublishedMessage()) {
                        // we don't need to process these messages since the
                        // global transaction has been rolled back.
                    } else if (wrapper.isReceivedMessage()) {
                        ReceivedMessageWrapper rmsg_wrapper =
                            (ReceivedMessageWrapper) wrapper;
                        MessageHandle handle =
                                (MessageHandle) rmsg_wrapper.getObject();

                        DestinationManager mgr = DestinationManager.instance();
                        DestinationCache cache =
                                mgr.getDestinationCache(handle.getDestination());
                        cache.returnMessageHandle(handle);
                    }
                } else {
                    // ignore since it is a state records.
                }
            }

            connection.commit();
        } catch (PersistenceException exception) {
            if (connection != null) {
                try {
                    connection.rollback();
                } catch (Exception nested) {
                    // ignore
                }
            }
            throw new XAException("Failed in ResourceManager.rollback : " +
                exception.toString());
        } catch (Exception exception) {
            throw new XAException("Failed in ResourceManager.rollback : " +
                exception.toString());
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (Exception nested) {
                    // ignore
                }
            }

            // and now mark the transaction as closed
            try {
                logTransactionState(xid, TransactionState.CLOSED);
            } catch (Exception exception) {
                throw new XAException("Error processing rollback : " + exception);
            }
        }
    }

    /**
     * Start work on behalf of a transaction branch specified in xid If TMJOIN
     * is specified, the start is for joining a transaction previously seen by
     * the resource manager
     *
     * @throws XAException - if there is a problem completing the call
     */
    public synchronized boolean setTransactionTimeout(int seconds)
        throws XAException {
        _txExpiryTime = seconds;
        return true;
    }

    // implementation of XAResource.start
    public synchronized void start(Xid id, int flags)
        throws XAException {

        //check the xid is not null
        if (id == null) {
            throw new XAException(XAException.XAER_NOTA);
        }

        // covert to our internal representation of an xid
        ExternalXid xid = new ExternalXid(id);

        // check that the flags are valid for this method
        if ((flags != XAResource.TMNOFLAGS) ||
            (flags != XAResource.TMJOIN) ||
            (flags != XAResource.TMRESUME)) {
            throw new XAException(XAException.XAER_PROTO);
        }

        switch (flags) {
            case XAResource.TMNOFLAGS:
                // check to see that the xid does not already exist
                if (isTransactionActive(xid)) {
                    throw new XAException(XAException.XAER_DUPID);
                }

                // otherwise log the start of the transaction
                try {
                    logTransactionState(xid, TransactionState.OPENED);
                } catch (Exception exception) {
                    throw new XAException("Error processing start : " + exception);
                }
                break;

            case XAResource.TMJOIN:
            case XAResource.TMRESUME:
                // joining a transaction previously seen by the resource
                // manager
                if (!isTransactionActive(xid)) {
                    throw new XAException(XAException.XAER_PROTO);
                }
                break;
        }
    }

    // override ServiceManager.start
    public void start()
        throws ServiceException {
        this.setState(ServiceState.RUNNING);
    }

    // override ServiceManager.stop
    public void stop()
        throws ServiceException {
        this.setState(ServiceState.STOPPED);
    }

    // override ServiceManager.run
    public void run() {
        // do nothing
    }

    /**
     * Return the resource manager identity
     *
     * @return the resource manager identity
     */
    public String getResourceManagerId() {
        return _rid;
    }

    /**
     * Create the next {@link TransactionLog} and add it to the list of
     * managed transaction logs.
     * <p>
     * The method will throw ResourceManagerException if there is a
     * problem completing the request.
     *
     * @throws ResourceManagerException
     */
    protected TransactionLog createNextTransactionLog()
        throws ResourceManagerException {
        TransactionLog newlog = null;

        synchronized (_logs) {
            try {
                // get the last log number
                long last = 1;
                if (!_logs.isEmpty()) {
                    last = getSequenceNumber(((TransactionLog) _logs.last()).getName());
                }

                // now that we have the last log number, increment it and use
                // it to build the name of the next log file.
                String name = _logDirectory + System.getProperty("file.separator") +
                    RM_LOGFILE_PREFIX + Long.toString(++last) + RM_LOGFILE_EXTENSION;

                // create a transaction log and add it to the collection
                newlog = new TransactionLog(name, true);
                _logs.add(newlog);
            } catch (TransactionLogException exception) {
                throw new ResourceManagerException(
                    "Error in createNextTransactionLog " + exception);
            }
        }

        return newlog;
    }

    /**
     * Build a list of all log files in the specified log directory
     *
     * @throws IllegalArgumentException - if the directory does not exist.
     */
    protected void buildLogFileList() {
        File dir = new File(_logDirectory);
        if ((!dir.exists()) ||
            (!dir.isDirectory())) {
            throw new IllegalArgumentException(_logDirectory +
                " is not a directory");
        }

        try {
            File[] list = dir.listFiles(new FilenameFilter() {

                // implementation of FilenameFilter.accept
                public boolean accept(File dir, String name) {
                    boolean result = false;

                    if ((name.startsWith(RM_LOGFILE_PREFIX)) &&
                        (name.endsWith(RM_LOGFILE_EXTENSION))) {
                        result = true;
                    }

                    return result;
                }
            });

            // add the files to the list
            synchronized (_logs) {
                for (int index = 0; index < list.length; index++) {
                    _logs.add(new TransactionLog(list[index].getPath(), false));
                }
            }
        } catch (Exception exception) {
            // replace this with the exception strategy
            exception.printStackTrace();
        }

    }

    /**
     * This method will process all the transaction logs, in the log diretory
     * and call recover on each of them.
     *
     * @throws ResourceManagerException - if there is a problem recovering
     */
    private synchronized void recover()
        throws ResourceManagerException {
        try {
            if (!_logs.isEmpty()) {
                Iterator iter = _logs.iterator();
                while (iter.hasNext()) {
                    TransactionLog log = (TransactionLog) iter.next();
                    HashMap records = log.recover();
                }
            }
        } catch (Exception exception) {
            throw new ResourceManagerException("Error in recover " +
                exception.toString());
        }
    }

    /**
     * Retrieve the transaction log for the specified transaction id
     *
     * @param txid - the transaction identity
     * @return TransactionLog
     * @throws TransactionLogException - if there is tx log exception
     * @throws ResourceManagerException - if there is a resource problem.
     */
    private TransactionLog getTransactionLog(ExternalXid txid)
        throws TransactionLogException, ResourceManagerException {
        TransactionLog log = (TransactionLog) _tridToLogCache.get(txid);
        if (log == null) {
            log = getCurrentTransactionLog();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合在线电影| 久久天堂av综合合色蜜桃网| 一区二区视频在线| 色综合欧美在线| 一个色综合av| 欧美一区二区大片| 国产一区二区不卡| 国产精品久久久久久亚洲毛片| av在线综合网| 一个色在线综合| 日韩欧美一级精品久久| 国产伦精品一区二区三区免费迷 | 懂色一区二区三区免费观看| 国产欧美日韩综合| 色嗨嗨av一区二区三区| 日本一道高清亚洲日美韩| wwwwxxxxx欧美| 97久久精品人人做人人爽50路 | 91精品国产色综合久久ai换脸 | 不卡电影一区二区三区| 一区二区激情小说| 欧美xxxxx裸体时装秀| 国产成人自拍在线| 一区二区三区中文字幕在线观看| 91精品在线一区二区| 国产精选一区二区三区 | 亚洲精品你懂的| 日韩三级精品电影久久久| 丰满少妇久久久久久久| 一区二区三区蜜桃网| 精品国产一区二区三区不卡| 97超碰欧美中文字幕| 麻豆精品久久久| 亚洲三级电影全部在线观看高清| 欧美精品在线一区二区三区| 国产白丝网站精品污在线入口| 亚洲电影在线免费观看| 国产日韩欧美不卡在线| 欧美午夜不卡视频| 国产成人一区在线| 亚洲成人动漫av| 亚洲欧洲av另类| 精品福利av导航| 欧美视频一区二| 成人精品视频网站| 美女视频黄免费的久久| 一区二区三区中文字幕精品精品| 国产欧美综合在线| 欧美一区二区日韩一区二区| 白白色亚洲国产精品| 国产又粗又猛又爽又黄91精品| 亚洲午夜精品网| 亚洲免费av在线| **欧美大码日韩| 国产午夜一区二区三区| 欧美成人一区二区三区在线观看 | 欧美日韩国产大片| 91免费版在线| 成人一区二区视频| 国产一区二区三区高清播放| 日本美女视频一区二区| 亚洲成在人线免费| 亚洲午夜精品17c| 一区二区三区精品视频在线| √…a在线天堂一区| 国产欧美视频一区二区| 久久久国产一区二区三区四区小说| 欧美一区二区三区播放老司机| 欧美午夜精品电影| 91国偷自产一区二区开放时间 | 欧美一级欧美三级在线观看| 欧美人与禽zozo性伦| 欧美日韩一区二区在线观看视频| 91香蕉国产在线观看软件| 成人精品一区二区三区中文字幕| 国产一区二区久久| 国产jizzjizz一区二区| 国产成人免费视频网站| 国产麻豆午夜三级精品| 国产精品99久久久久久似苏梦涵| 国产精品一区免费在线观看| 国产成人三级在线观看| 成人黄色一级视频| 色悠悠久久综合| 欧美日韩国产综合久久| 欧美肥妇free| 欧美大胆人体bbbb| 久久久精品人体av艺术| 日本一区二区成人在线| 国产精品国产三级国产三级人妇| 亚洲女爱视频在线| 香蕉久久夜色精品国产使用方法| 日韩有码一区二区三区| 精品中文av资源站在线观看| 狠狠色丁香婷综合久久| 波多野结衣亚洲一区| 色哟哟在线观看一区二区三区| 欧美色图在线观看| 日韩欧美在线综合网| 久久综合中文字幕| 最好看的中文字幕久久| 香蕉久久一区二区不卡无毒影院| 玖玖九九国产精品| 99精品久久久久久| 69久久99精品久久久久婷婷 | 亚洲午夜一区二区| 男女性色大片免费观看一区二区 | 看片的网站亚洲| 懂色av一区二区三区蜜臀| 色吧成人激情小说| 欧美白人最猛性xxxxx69交| 中文字幕成人在线观看| 亚洲一区欧美一区| 国产综合色在线| 91麻豆免费在线观看| 91精品国产麻豆| 国产人妖乱国产精品人妖| 一区二区三区日韩欧美| 精品一区二区三区视频在线观看| 波多野结衣视频一区| 欧美日韩另类一区| 久久人人爽人人爽| 亚洲综合一二三区| 高清成人免费视频| 3atv在线一区二区三区| 日本一区二区三区dvd视频在线| 亚洲高清在线视频| www.亚洲在线| 日韩色在线观看| 一区二区三区四区av| 国产一区二三区| 欧美理论电影在线| 中文字幕在线一区免费| 毛片一区二区三区| 欧美视频一区在线观看| 久久久99久久| 老司机精品视频导航| 欧美日韩免费一区二区三区视频| 中文字幕不卡在线| 精品无码三级在线观看视频 | 捆绑变态av一区二区三区| 欧美亚洲日本国产| 中文字幕成人av| 国产一区欧美二区| 日韩免费观看高清完整版在线观看| 一区二区成人在线| av亚洲精华国产精华精| 日本一区二区三区视频视频| 激情图片小说一区| 日韩精品一区二区三区在线| 午夜精彩视频在线观看不卡| 日本高清免费不卡视频| 日本一二三四高清不卡| 国产高清一区日本| 欧美精品一区二区三区高清aⅴ| 日韩黄色在线观看| 欧美疯狂做受xxxx富婆| 亚洲第一主播视频| 日本高清不卡aⅴ免费网站| 亚洲三级小视频| 色欧美片视频在线观看在线视频| 欧美国产综合色视频| 成人深夜福利app| 国产精品污www在线观看| 国产黑丝在线一区二区三区| 久久五月婷婷丁香社区| 久久国产人妖系列| 久久先锋影音av鲁色资源| 国产露脸91国语对白| 中文字幕精品综合| 国产aⅴ精品一区二区三区色成熟| 久久久91精品国产一区二区三区| 国产成人免费高清| 国产精品久久久久桃色tv| 色婷婷综合久色| 亚洲国产cao| 日韩一区二区三| 激情综合色综合久久综合| 久久久91精品国产一区二区精品 | 精品一区精品二区高清| 精品国产麻豆免费人成网站| 精品无人码麻豆乱码1区2区 | 亚洲男人的天堂在线aⅴ视频| 99久久久国产精品| 亚洲综合免费观看高清完整版在线| 91国产成人在线| 日韩国产欧美在线视频| 精品久久久久久久一区二区蜜臀| 国内偷窥港台综合视频在线播放| 欧美韩日一区二区三区四区| 91香蕉视频在线| 日韩精品久久久久久| 精品剧情v国产在线观看在线| 国产成人日日夜夜| 亚洲一区二区三区三| 精品三级在线看| 99精品偷自拍| 日本美女一区二区三区| 国产拍揄自揄精品视频麻豆| 欧洲中文字幕精品|