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

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

?? resourcemanager.java

?? 一個(gè)java方面的消息訂閱發(fā)送的源碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號(hào):
            addTridLogEntry(txid, log);
        }

        return log;
    }

    /**
     * Get the current transaction log. It will check the last transaction
     * log opened by the resource manager and determine whether there is
     * space enough to process another transaction.
     * <p>
     * If there is space enough then it will return that transaction,
     * otherwise it will create a new transaction log for the resource
     *
     * @return TransactionLog - the transaction log to use
     * @throws ResourceManagerException
     * @throws TransactionLogException
     */
    private TransactionLog getCurrentTransactionLog()
        throws TransactionLogException, ResourceManagerException {
        TransactionLog log = null;

        synchronized (_logs) {
            if (_logs.size() > 0) {
                log = (TransactionLog) _logs.last();
            }

            if ((log == null) ||
                (log.size() > _logFileSize)) {
                log = createNextTransactionLog();
            }
        }

        return log;
    }

    /**
     * Add an entry to the trid log cache table for the specified trid and
     * transaction log mapping.
     *
     * @param trid - the transaction identifier
     * @param log - the transaction log
     */
    private void addTridLogEntry(ExternalXid trid, TransactionLog log) {
        synchronized (_cacheLock) {
            // one to one relationship
            _tridToLogCache.put(trid, log);

            // one to many relationship
            Vector trids = (Vector) _logToTridCache.get(log);
            if (trids == null) {
                trids = new Vector();
                _logToTridCache.put(log, trids);
            }
            trids.addElement(trid);
        }
    }

    /**
     * Check whether the specified log is also the current log
     *
     * @param log - the log to check
     * @return boolean - true if it is
     */
    private boolean isCurrentTransactionLog(TransactionLog log) {
        boolean result = false;

        if (_logs.size() > 0) {
            result = log.equals(_logs.last());
        }

        return result;
    }

    /**
     * Remove an entry to the trid log cache table for the specified trid and
     * transaction log mapping.
     *
     * @param trid - the transaction identifier
     * @param log - the transaction log
     */
    private void removeTridLogEntry(ExternalXid trid, TransactionLog log) {
        synchronized (_cacheLock) {

            // one to one relationship
            _tridToLogCache.remove(trid);

            // one to many relationship
            Vector trids = (Vector) _logToTridCache.get(log);
            if (trids != null) {
                trids.remove(trid);
                if (trids.size() == 0) {
                    _logToTridCache.remove(log);
                }
            }
        }
    }

    /**
     * Return an arrya of records, both state and date, for the specified
     * global transaction
     *
     * @param xid - the global transaction id
     * @param rid - the resource id
     * @return Object[] - array of records
     */
    protected Object[] getTransactionRecords(ExternalXid xid, String rid) {
        Object[] records;

        // we also want to add this to the transaction data for that
        // txid
        LinkedList list = (LinkedList) _activeTransactions.get(xid);
        if (list != null) {
            records = list.toArray();
        } else {
            records = new Object[0];
        }

        return records;
    }


    /**
     * Return the sequence number of the file
     * files are associated with a unique number
     *
     * @param name - the file name to investigate
     * @return long - the transaction log number
     * @throws ResourceManagerException
     */
    protected long getSequenceNumber(String name)
        throws ResourceManagerException {
        int start = name.indexOf(RM_LOGFILE_PREFIX) +
            RM_LOGFILE_PREFIX.length();
        int end = name.indexOf(RM_LOGFILE_EXTENSION);

        // the number must be between the start and end positions
        try {
            return Long.parseLong(name.substring(start, end));
        } catch (NumberFormatException exception) {
            throw new ResourceManagerException(
                "Invalid name assigned to resource manager file " + name);
        }
    }

    /**
     * Return true if the specified transaction is active
     *
     * @param xid - the gobal transaction identifier
     */
    private synchronized boolean isTransactionActive(ExternalXid xid) {
        return _activeTransactions.containsKey(xid);
    }

    /**
     * Dump the specified records to the screen
     */
    private void dumpRecovered(HashMap records) {
        Iterator iter = records.keySet().iterator();
        while (iter.hasNext()) {
            ExternalXid txid = (ExternalXid) iter.next();
            LinkedList list = (LinkedList) records.get(txid);
            Iterator oiter = list.iterator();
            while (oiter.hasNext()) {
                Object object = oiter.next();
                if (object instanceof StateTransactionLogEntry) {
                    System.err.println("Recovered [" + txid + "] Class " +
                        object.getClass().getName() + " [" +
                        ((StateTransactionLogEntry) object).getState().toString() + "]");
                } else {
                    System.err.println("Recovered [" + txid + "] Class " +
                        object.getClass().getName());
                }
            }
        }
    }


    /**
     * Helper and type-safe method for creating a wrapper object for published
     * messages
     *
     * @param message - the message published
     * @return PublishedMessageWrapper
     */
    private PublishedMessageWrapper createPublishedMessageWrapper(
        MessageImpl message) {
        return new PublishedMessageWrapper(message);
    }

    /**
     * Helper and type-safe method for creating a wrapper object for received
     * messages
     *
     * @param id - the identity of the consumer receiving the message
     * @param handle - the handle of the message received
     * @return ReceivedMessageWrapper
     */
    private ReceivedMessageWrapper createReceivedMessageWrapper(
        long id, MessageHandle handle) {
        return new ReceivedMessageWrapper(id, handle);
    }

    /**
     * This functor is used by various collections to order the transaction log
     * files created by this resource manager. The resource manager will create
     * log files with sequentially increasing numbers (i.e xxx01.log, xxx2.log
     */
    private class TranLogFileComparator
        implements Comparator {

        // implementation of Comparator.comapre
        public int compare(Object o1, Object o2) {
            int result = -1;

            try {
                if ((o1 instanceof TransactionLog) &&
                    (o2 instanceof TransactionLog)) {
                    long seq1 = getSequenceNumber(((TransactionLog) o1).getName());
                    long seq2 = getSequenceNumber(((TransactionLog) o2).getName());

                    if (seq1 > seq2) {
                        result = 1;
                    } else if (seq1 < seq2) {
                        result = -1;
                    } else {
                        result = 0;
                    }
                } else {
                    throw new ClassCastException("o1 = " +
                        o1.getClass().getName() + " and o2 = " +
                        o2.getClass().getName());
                }
            } catch (Exception exception) {
                throw new RuntimeException("Error in ResourceManager.compare " +
                    exception.toString());
            }

            return result;
        }

        // implementation of Comparator.equals
        public boolean equals(Object obj) {
            if (obj instanceof TranLogFileComparator) {
                return true;
            }

            return false;
        }
    }


    /**
     * This private member class is used to wrap the transactional object,
     * which for this particular resource manager is a published message or
     * a received message handle.
     */
    abstract private class TransactionalObjectWrapper {

        /**
         * The transactional object instance
         */
        private Object _object;

        /**
         * Create an instance of the wrapper using the type and the object
         *
         * @param object - the associated object
         */
        public TransactionalObjectWrapper(Object object) {
            _object = object;
        }

        /**
         * Check whether the wrapper contains a published message. Note that a
         * published message has a {@link MessageImpl} a the transactional
         * object.
         *
         * @return boolean - true if it is
         */
        public boolean isPublishedMessage() {
            return this instanceof PublishedMessageWrapper;
        }

        /**
         * Check whether the wrapper contains a received message handle. Note
         * that a received message contains a {@link MessageHandle} as the
         * transactional object.
         *
         * @return boolean - true if it does
         */
        public boolean isReceivedMessage() {
            return this instanceof ReceivedMessageWrapper;
        }

        /**
         * Return the transaction object
         *
         * @return Object
         */
        public Object getObject() {
            return _object;
        }

    }


    /**
     * This private member class is used to wrap a published message
     */
    private class PublishedMessageWrapper extends TransactionalObjectWrapper {

        /**
         * Create an instance of the wrapper using the specified message
         *
         * @param message - the message to wrap
         */
        public PublishedMessageWrapper(MessageImpl message) {
            super(message);
        }

        /**
         * Return an instance of the message object
         *
         * @return MessageImpl
         */
        public MessageImpl getMessage() {
            return (MessageImpl) super.getObject();
        }
    }


    /**
     * This private member class is used to wrap a received message
     */
    private class ReceivedMessageWrapper extends TransactionalObjectWrapper {

        /**
         * Caches the id of the {@link ConsumerEndpoint} that is processed
         * this handle
         */
        private long _consumerId;

        /**
         * Create an instance of the wrapper using the specified message
         *
         * @param id - the identity of the consumer endpoint
         * @param handle - the handle to the message
         */
        public ReceivedMessageWrapper(long id, MessageHandle handle) {
            super(handle);
            _consumerId = id;
        }

        /**
         * Return a reference to the  consumer identity
         *
         * @return String
         */
        public long getConsumerId() {
            return _consumerId;
        }

        /**
         * Return an instance of the message handle
         *
         * @return MessageHandle
         */
        public MessageHandle getMessageHandle() {
            return (MessageHandle) super.getObject();
        }
    }

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看日韩国产| 亚洲欧美色综合| 国产精品欧美经典| 日一区二区三区| av日韩在线网站| 亚洲成人精品在线观看| 国模冰冰炮一区二区| 欧美精品第1页| 亚洲天堂中文字幕| 国产成人在线网站| 日韩欧美国产不卡| 性做久久久久久久免费看| 91麻豆福利精品推荐| 久久久亚洲高清| 日韩vs国产vs欧美| 国产嫩草影院久久久久| 奇米色777欧美一区二区| 欧美三级在线看| 亚洲欧美色综合| 97久久超碰国产精品| 欧美激情一区在线观看| 国产精品一区二区无线| 久久综合狠狠综合久久综合88| 亚洲高清不卡在线| 欧美午夜精品免费| 粉嫩蜜臀av国产精品网站| 欧美高清视频一二三区 | 成人黄色777网| 久久婷婷久久一区二区三区| 久久成人免费网| 日本女人一区二区三区| 在线成人av影院| 日本最新不卡在线| 日韩欧美亚洲一区二区| 精品一区二区三区日韩| 欧美www视频| 国产精品一区二区视频| 中文字幕免费在线观看视频一区| 国产很黄免费观看久久| 日韩一区有码在线| 欧美亚洲综合一区| 国产成人啪免费观看软件| 中文在线一区二区| 色8久久人人97超碰香蕉987| 亚洲影院久久精品| 91精品国产品国语在线不卡| 精东粉嫩av免费一区二区三区| 久久久亚洲午夜电影| 波多野结衣在线一区| 亚洲精品国产无套在线观| 欧美日韩情趣电影| 欧美高清精品3d| 韩国v欧美v亚洲v日本v| 国产精品国产三级国产aⅴ无密码| caoporn国产精品| 午夜一区二区三区视频| www久久久久| 93久久精品日日躁夜夜躁欧美| 亚洲成人一区在线| 久久久久久久久免费| 色狠狠桃花综合| 蜜臀久久久99精品久久久久久| 五月激情综合婷婷| 日韩欧美一级在线播放| 99re这里只有精品首页| 日韩一区欧美二区| 中文字幕欧美区| 欧美精选午夜久久久乱码6080| 国产精品一区二区黑丝| 亚洲国产aⅴ成人精品无吗| 久久免费看少妇高潮| 91视频你懂的| 国产乱淫av一区二区三区| 成人国产精品免费观看视频| 亚洲a一区二区| 国产欧美日韩三区| 欧美一区二视频| 99re6这里只有精品视频在线观看| 免费成人在线网站| 亚洲美女视频在线| 日本一区二区三级电影在线观看| 欧美亚洲尤物久久| 风间由美中文字幕在线看视频国产欧美| 亚洲妇熟xx妇色黄| 国产伦理精品不卡| 亚洲图片自拍偷拍| 成人免费在线播放视频| 2024国产精品| 欧美日韩色综合| 色综合久久久久| 成人一级视频在线观看| 美女网站在线免费欧美精品| 亚洲午夜av在线| 综合电影一区二区三区| 中文在线资源观看网站视频免费不卡 | 亚洲国产精品影院| 国产精品福利av | 337p亚洲精品色噜噜| 91在线视频网址| 福利一区二区在线| 国产在线观看一区二区| 蜜乳av一区二区| 视频一区二区三区入口| 亚洲线精品一区二区三区| 久久精品国产秦先生| 日本91福利区| 日韩av高清在线观看| 午夜精品福利在线| 午夜精品一区在线观看| 亚洲一区自拍偷拍| 亚洲一区二区在线播放相泽 | 琪琪一区二区三区| 天涯成人国产亚洲精品一区av| www.成人在线| 成人av电影在线| 一本大道久久a久久精品综合| 成人av网站在线| 91麻豆文化传媒在线观看| 一本大道久久a久久精品综合| 91毛片在线观看| 欧美日韩国产一级二级| 欧美一二三在线| 欧美岛国在线观看| 精品成人私密视频| 国产丝袜美腿一区二区三区| 久久久99精品久久| 欧美a级理论片| 美腿丝袜亚洲色图| 国产精品一二三四| 91在线观看美女| 欧美性大战久久久久久久| 日韩亚洲电影在线| 久久久久久久久久久久久女国产乱| 国产喂奶挤奶一区二区三区| 亚洲私人黄色宅男| 天天免费综合色| 国产成人av电影在线观看| 99精品视频一区二区三区| 中文字幕一区二区三区四区不卡| 综合久久久久久| 亚洲va欧美va国产va天堂影院| 三级在线观看一区二区| 国产99久久久国产精品| 一本一道波多野结衣一区二区| 欧美日韩电影在线| 国产亚洲成年网址在线观看| 一区二区三区在线观看国产| 青青草一区二区三区| www.在线欧美| 日韩欧美在线不卡| 中文字幕中文乱码欧美一区二区| 国产成人一区在线| 欧美三级韩国三级日本一级| 国产亚洲综合性久久久影院| 亚洲曰韩产成在线| 国产成人丝袜美腿| 91精品国产入口| 亚洲欧洲精品天堂一级| 日本欧美大码aⅴ在线播放| 成人黄色小视频| 精品理论电影在线观看| 亚洲综合另类小说| 国产成人精品免费网站| 91精品婷婷国产综合久久性色 | 亚洲一区二区视频在线观看| 久久国产精品免费| 欧美日韩精品免费观看视频| 亚洲国产高清aⅴ视频| 麻豆91精品91久久久的内涵| 91网站在线播放| 久久先锋影音av鲁色资源| 午夜精品在线视频一区| 91免费视频网| 国产精品丝袜黑色高跟| 久久99精品国产麻豆不卡| 欧美浪妇xxxx高跟鞋交| 久久电影国产免费久久电影| 精品视频免费在线| 亚洲精品免费播放| 99在线精品观看| 国产欧美一区在线| 国产精品一区二区视频| 精品久久人人做人人爱| 日韩精品免费专区| 欧美日韩高清在线| 亚洲成av人片在线观看无码| 色婷婷综合久色| 亚洲免费av高清| 91视频在线观看| 国产高清久久久久| 久久免费视频色| 粉嫩aⅴ一区二区三区四区五区| 亚洲精品一区二区三区香蕉| 玖玖九九国产精品| 欧美一区二区三区视频在线| 日韩激情av在线| 在线观看91av| 美女在线一区二区| 精品国产一区二区在线观看| 另类小说色综合网站|