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

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

?? resourcemanager.java

?? 一個java方面的消息訂閱發送的源碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
     * @return int
     */
    public int getGCMode() {
        return _gcMode;
    }

    /**
     * Check whether garbage collection has been disabled
     *
     * @return boolean - true if gc is disabled
     */
    public boolean gcDisabled() {
        return (_gcMode == GC_DISABLED) ? true : false;
    }

    /**
     * Log this published message so that it can be passed through the system
     * when the associated global transaction commits.
     *
     * @param xid - the global transaction identity
     * @param message - the message published
     * @throws TransactionLogException - error adding the entry
     * @throws ResourceManagerException - error getting the trnasaction log
     * @throws JMSException - if there is an issue with prep'ing the message
     */
    public synchronized void logPublishedMessage(Xid xid, MessageImpl message)
        throws TransactionLogException, ResourceManagerException, JMSException {
        MessageMgr.instance().prepare(message);
        logTransactionData(new ExternalXid(xid), _rid,
            createPublishedMessageWrapper(message));
    }

    /**
     * Log that this message handle was sent to the consumer within the specified
     * global transaction identity. The message will be acknowledged when the
     * global transaction commits. Alternatively, if the global transaction is
     * rolled back the message handle will be returned to the destination
     *
     * @param xid the global transaction identity
     * @param id the consumer receiving this message
     * @param handle - the handle of the message received
     * @throws TransactionLogException - error adding the entry
     * @throws ResourceManagerException - error getting the transaction log
     */
    public synchronized void logReceivedMessage(Xid xid, long id, MessageHandle handle)
        throws TransactionLogException, ResourceManagerException {
        logTransactionData(new ExternalXid(xid), _rid,
            createReceivedMessageWrapper(id, handle));
    }

    /**
     * Add an {@link StateTransactionLogEntry} using the specified txid,
     * rid and state
     *
     * @param xid - the transaction identifier
     * @param state - the transaction log state
     * @throws TransactionLogException - error adding the entry
     * @throws ResourceManagerException - error getting the trnasaction log
     */
    public synchronized void logTransactionState(Xid xid, TransactionState state)
        throws TransactionLogException, ResourceManagerException {
        ExternalXid txid = new ExternalXid(xid);
        switch (state.getOrd()) {
            case TransactionState.OPENED_ORD:
                {
                    TransactionLog log = getCurrentTransactionLog();
                    addTridLogEntry(txid, log);
                    log.logTransactionState(txid, _txExpiryTime * 1000, _rid,
                        state);

                    // cache the transaction state
                    _activeTransactions.put(txid, new LinkedList());
                }
                break;

            case TransactionState.PREPARED_ORD:
                // cache the transaction state
                LinkedList list = (LinkedList) _activeTransactions.get(txid);
                if (list != null) {
                    list.add(state);
                } else {
                    throw new ResourceManagerException("Trasaction " + txid +
                        " is not active.");
                }
                break;

            case TransactionState.CLOSED_ORD:
                {
                    TransactionLog log = getTransactionLog(txid);
                    log.logTransactionState(txid, _txExpiryTime * 1000, _rid,
                        state);
                    removeTridLogEntry(txid, log);

                    // check whether this log has anymore open transactions
                    synchronized (_cacheLock) {
                        if ((_logToTridCache.get(log) == null) &&
                            (!isCurrentTransactionLog(log))) {
                            log.close();

                            // now check if gc mode is GC_SYNCHRONOUS. If it is
                            // remove the log file
                            if (_gcMode == GC_SYNCHRONOUS) {
                                try {
                                    log.destroy();
                                } catch (TransactionLogException exception) {
                                    exception.printStackTrace();
                                }
                            }
                        }
                    }

                    // we also want to remove this entry from the list
                    // of active transactions
                    _activeTransactions.remove(txid);
                }
                break;

            default:
                throw new ResourceManagerException("Cannot process tx state " +
                    state);
        }
    }

    /**
     * Add an {@link DataTransactionLogEntry} using the specified txid,
     * rid and data
     *
     * @param txid - the transaction identifier
     * @param rid - the resource identifier
     * @throws TransactionLogException - error adding the entry
     * @throws ResourceManagerException - error getting the trnasaction log
     */
    synchronized void logTransactionData(ExternalXid txid, String rid,
                                         Object data)
        throws ResourceManagerException, TransactionLogException {
        getTransactionLog(txid).logTransactionData(txid, _txExpiryTime * 1000,
            rid, data);

        // we also want to add this to the transaction data for that
        // txid
        LinkedList list = (LinkedList) _activeTransactions.get(txid);
        if (list != null) {
            list.add(data);
        } else {
            throw new ResourceManagerException("Trasaction " + txid +
                " is not active.");
        }
    }

    /**
     * This is the entry point for the garbage collection callback. It scans
     * through the each transaction log file and determines whether it can
     * be garbage collected. If it can then it simply destroys the corresponding
     * TransactionLog.
     */
    public void garbageCollect() {
        try {
            int gcfiles = 0;

            // if there are no transaction log files then return
            if (_logs.size() == 0) {
                return;
            }

            TreeSet copy = null;
            synchronized (_logs) {
                copy = new TreeSet(_logs);
            }

            // remove the current log file, since this is likely to be the
            // current log file
            copy.remove(_logs.last());

            // process each of the remaining log files
            while (copy.size() > 0) {
                TransactionLog log = (TransactionLog) copy.first();
                copy.remove(log);
                if (log.canGarbageCollect()) {
                    // destroy the log
                    log.destroy();

                    // remove it from the log cache
                    synchronized (_logs) {
                        _logs.remove(log);
                    }

                    // increment the number of garbafe collected files
                    ++gcfiles;
                }
            }

            // print an informative message
            _log.info("[RMGC] Collected " + gcfiles + " files.");
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    /**
     * Ensure that a transaction with the specified xid is currently active.
     * If this is the case then commit the transaction based onb the value
     * of the onePhase flag.
     * <p>
     * This will have the effect of passing all messages through
     *
     * @param id - the xa transaction identity
     * @param onePhase - treu if it is a one phase commit
     * @throws XAException - if there is a problem completing the call
     */
    public synchronized void commit(Xid id, boolean onePhase)
        throws XAException {
        // check that 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 transaction is active and open. We should
        // not be allowed to commit a committed transaction.
        if (!isTransactionActive(xid)) {
            throw new XAException(XAException.XAER_PROTO);
        }

        // process all the messages associated with this global transaction
        // If a message has been  published then sent it to the message mgr
        // for processing. If a message has been consumed then remove it
        // from the list of unconsumed messages.
        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()) {
                        // send the published message to the message manager
                        MessageMgr.instance().add(connection,
                            (MessageImpl) wrapper.getObject());

                    } else if (wrapper.isReceivedMessage()) {
                        // if it is a received message handle then simply
                        // delete it and mark it as acknowledged
                        MessageHandle handle = ((ReceivedMessageWrapper) (wrapper)).getMessageHandle();
                        if (handle.isPersistent()) {
                            handle.destroy(connection);
                        } else {
                            handle.destroy();
                        }
                    }
                } else {
                    // ignore since it is a state records.
                }
            }
            connection.commit();
        } catch (PersistenceException exception) {
            SQLHelper.rollback(connection);
            throw new XAException("Failed in ResourceManager.commit : " +
                exception.toString());
        } catch (Exception exception) {
            throw new XAException("Failed in ResourceManager.commit : " +
                exception.toString());
        } finally {
            SQLHelper.close(connection);

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

    /**
     * Ends the work performed on behalf of a transaction branch. The resource
     * manager disassociates the XA resource from the transaction branch
     * specified and let the transaction be completedCommits an XA transaction
     * that is in progress.
     *
     * @param id - the xa transaction identity
     * @param flags - one of TMSUCCESS, TMFAIL, or TMSUSPEND
     * @throws XAException - if there is a problem completing the call
     */
    public synchronized void end(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.TMSUSPEND) ||
            (flags != XAResource.TMSUCCESS) ||
            (flags != XAResource.TMFAIL)) {
            throw new XAException(XAException.XAER_PROTO);
        }

        switch (flags) {
            case XAResource.TMFAIL:
                // check that the transaction exists
                if (!isTransactionActive(xid)) {
                    throw new XAException(XAException.XAER_PROTO);
                }

                // do not process that associated data, simply rollback
                rollback(xid);
                break;

            case XAResource.TMSUSPEND:
                // check that the transaction is opened
                if (!isTransactionActive(xid)) {
                    throw new XAException(XAException.XAER_PROTO);
                }
                break;

            case XAResource.TMSUCCESS:
                // nothing to do here but check that the resource manager is
                // in a consistent state wrt to this xid. The xid should not
                // be active if it received the commit, forget etc.
                if (isTransactionActive(xid)) {
                    throw new XAException(XAException.XAER_PROTO);
                }
                break;
        }
    }

    /**
     * Tell the resource manager to forget about a heuristically completed
     * transaction branch.
     *
     * @param id - the xa transaction identity
     * @throws XAException - if there is a problem completing the call
     */
    public synchronized void forget(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);
        }

        // call rollback to complete the work
        rollback(id);
    }

    /**
     * Return the transaction timeout for this instance of the resource
     * manager.
     *
     * @return int - the timeout in seconds
     * @throws XAException - if there is a problem completing the call
     */
    public synchronized int getTransactionTimeout()
        throws XAException {
        return _txExpiryTime;
    }

    /**

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费视频视频在线观看免费 | 色综合久久久久网| 五月天国产精品| 国产精品狼人久久影院观看方式| 欧美日韩精品欧美日韩精品一| www.成人在线| 国产精品白丝jk黑袜喷水| 午夜视频在线观看一区| 日韩理论片中文av| 国产婷婷色一区二区三区| 91精品国产乱码久久蜜臀| 欧美亚洲高清一区二区三区不卡| 成人精品一区二区三区四区| 黄色资源网久久资源365| 婷婷久久综合九色综合绿巨人| 最新国产精品久久精品| 国产午夜精品久久久久久久| 日韩片之四级片| 欧美伦理电影网| 在线观看不卡一区| 色综合视频在线观看| caoporen国产精品视频| 国产不卡一区视频| 国产麻豆日韩欧美久久| 极品少妇xxxx偷拍精品少妇| 欧美a级理论片| 日本aⅴ免费视频一区二区三区| 亚洲成精国产精品女| 亚洲午夜精品网| 亚洲最大成人网4388xx| 亚洲欧美激情在线| 日韩伦理电影网| 亚洲男人的天堂在线观看| 亚洲人成影院在线观看| 亚洲视频一二三区| 亚洲欧美综合另类在线卡通| 国产精品久久久久久久久免费桃花 | 国产真实乱对白精彩久久| 激情成人综合网| 国产揄拍国内精品对白| 国产盗摄女厕一区二区三区 | 欧美中文字幕一二三区视频| 91精品91久久久中77777| 欧美在线免费播放| 欧美日本乱大交xxxxx| 欧美丰满美乳xxx高潮www| 欧美一区二区三区免费大片| 日韩美女一区二区三区| 久久精品视频免费| 国产精品色眯眯| 亚洲嫩草精品久久| 亚洲成人7777| 久久99精品久久久久| 国产成人av在线影院| 99久久伊人精品| 欧美色爱综合网| 欧美成人r级一区二区三区| 久久综合一区二区| 国产精品国产自产拍高清av | 91免费看视频| 4hu四虎永久在线影院成人| 欧美精品一区二区三区在线| 国产欧美日韩一区二区三区在线观看| 亚洲视频综合在线| 日本伊人色综合网| 成人自拍视频在线观看| 欧美系列亚洲系列| 精品成人免费观看| 亚洲色图欧美偷拍| 日本三级韩国三级欧美三级| 国产99一区视频免费 | 欧美一区二区三区四区五区| 久久亚洲影视婷婷| 一区二区三区中文在线观看| 美腿丝袜亚洲综合| 不卡免费追剧大全电视剧网站| 欧美伊人精品成人久久综合97| 26uuu国产在线精品一区二区| 亚洲色图20p| 国产综合久久久久久久久久久久| 91麻豆国产在线观看| 欧美电影免费观看完整版| 国产精品视频看| 青青草国产成人99久久| youjizz久久| 日韩午夜在线观看视频| 亚洲精品视频在线看| 久久不见久久见免费视频1| 91成人免费在线视频| 久久久精品国产免大香伊| 午夜电影一区二区| av一区二区三区黑人| 日韩欧美在线网站| 亚洲综合丝袜美腿| 成人一道本在线| 日韩精品专区在线| 亚洲成人资源在线| 色综合久久中文字幕| 日韩精品最新网址| 午夜精品aaa| 日本韩国欧美三级| 国产精品久线观看视频| 另类欧美日韩国产在线| 欧美人狂配大交3d怪物一区| 亚洲视频电影在线| 成人不卡免费av| 国产午夜精品在线观看| 免费观看久久久4p| 欧美久久久影院| 亚洲综合一区在线| av高清久久久| 国产精品网站在线观看| 国产精品亚洲人在线观看| 日韩精品一区二区三区四区| 日韩成人免费看| 欧美日韩一区二区三区不卡| 亚洲日本在线a| 91伊人久久大香线蕉| 欧美激情在线看| 国产成人精品影视| 久久久777精品电影网影网| 麻豆91精品91久久久的内涵| 欧美日韩国产免费一区二区| 一区二区三区小说| 在线亚洲一区观看| 亚洲一区成人在线| 欧美天堂一区二区三区| 亚洲国产一二三| 精品视频资源站| 亚洲国产va精品久久久不卡综合| 欧美在线视频日韩| 亚洲一区二区免费视频| 欧美色爱综合网| 三级一区在线视频先锋 | 奇米影视一区二区三区| 欧美精品久久天天躁| 午夜久久福利影院| 欧美一级在线视频| 蜜桃av一区二区三区电影| 欧美tk—视频vk| 国产乱人伦偷精品视频不卡| 欧美国产欧美综合| 99视频在线精品| 亚洲综合激情网| 欧美美女视频在线观看| 日本中文字幕一区| 欧美va亚洲va国产综合| 国产成人小视频| 亚洲免费av高清| 欧美日韩在线免费视频| 美洲天堂一区二卡三卡四卡视频| xnxx国产精品| 99久久精品情趣| 亚洲国产精品尤物yw在线观看| 欧美一区二区黄| 国产iv一区二区三区| 亚洲色图丝袜美腿| 欧美精品日日鲁夜夜添| 国产一区二区视频在线| 亚洲欧洲成人自拍| 777xxx欧美| 国产91精品露脸国语对白| 亚洲精品一二三四区| 日韩一区二区三区三四区视频在线观看 | 亚洲久本草在线中文字幕| 欧美日本视频在线| 国产精品白丝av| 亚洲国产精品嫩草影院| 久久色.com| 91福利国产成人精品照片| 久久精品72免费观看| 国产精品乱码人人做人人爱| 色婷婷激情综合| 国产一区二区三区免费观看| 一区二区在线看| 日韩一区二区三区视频在线| 国产精品视频一二| 91精品国产免费| 99国产精品久久久久久久久久久| 午夜不卡av在线| 中文字幕永久在线不卡| 日韩精品专区在线| 色婷婷久久久综合中文字幕| 黑人巨大精品欧美一区| 一区二区三区免费网站| 久久精品亚洲精品国产欧美| 欧美日韩在线综合| 99久久亚洲一区二区三区青草| 男人的j进女人的j一区| 亚洲人123区| 国产视频在线观看一区二区三区 | 亚洲美女精品一区| 2021久久国产精品不只是精品| 色欧美乱欧美15图片| 国产美女精品在线| 青青国产91久久久久久| 亚洲夂夂婷婷色拍ww47| 国产精品美日韩| 国产日韩欧美激情| 欧美电影免费观看完整版|