Package com.sun.messaging.jmq.util

Examples of com.sun.messaging.jmq.util.PHashMapLoadException


    private void loadClientData() throws PHashMapLoadException {
       
        if (!_useMmappedFile) return;

        PHashMapLoadException loadException = null;

        Iterator itr = _gxidMap.entrySet().iterator();
        while (itr.hasNext()) {
            Throwable ex = null;
            Map.Entry entry = (Map.Entry)itr.next();
            Object key = entry.getKey();
            LogRecord value = (LogRecord)entry.getValue();
            int cnt = value.getBranchCount();
            if (cnt <= 0) continue;
            byte[] cdata = null;
            try {
                 cdata = ((PHashMapMMF)_gxidMap).getClientData(key);
                 if (cdata != null && cdata.length > 0) {
                     value.updateBranchFromClientData(cdata);
                 }
            } catch (Throwable e) {
                ex = e;
            }

            if (ex != null) {
                PHashMapLoadException le = new PHashMapLoadException(
                    "Failed to load client data [cdata=" + cdata + "]");
                le.setKey(key);
                le.setValue(value);
                le.setNextException(loadException);
                le.initCause(ex);
                loadException = le;
            }
        }

        if (loadException != null) {
View Full Code Here


        if (!updateOptimization) {
            return; // nothing to do
        }

        PHashMapLoadException loadException = null;

        Iterator itr = tidMap.entrySet().iterator();
        while (itr.hasNext()) {
            Throwable ex = null;
            Map.Entry entry = (Map.Entry)itr.next();
            Object key = entry.getKey();
            TransactionInfo value = (TransactionInfo)entry.getValue();
            byte[] cData = null;
            try {
                cData = ((PHashMapMMF)tidMap).getClientData(key);
                if (cData != null && cData.length > 0) {
                    int state = (int)cData[0]; // 1st byte is the modified state
                    value.getTransactionState().setState(state); // update txn state

                    // Now read in modified txn broker states
                    TransactionBroker[] bkrs = value.getTransactionBrokers();
                    if (bkrs != null) {
                        for (int i = 0, len = bkrs.length; i < len; i++) {
                            TransactionBroker bkr = bkrs[i];

                            // update bkr's state
                            boolean isComplete = ((int)cData[i+1] == 1); // 1 == true
                            bkr.setCompleted(isComplete);
                        }
                    }
                }
            } catch (Throwable e) {
                ex = e;
            }

            if (ex != null) {
                PHashMapLoadException le = new PHashMapLoadException(
                    "Failed to load client data [cData=" + cData + "]");
                le.setKey(key);
                le.setValue(value);
                le.setNextException(loadException);
                le.initCause(ex);
                loadException = le;
            }
        }

        if (loadException != null) {
View Full Code Here

        if (!updateOptimization) {
            return; // nothing to do
        }

        PHashMapLoadException loadException = null;

        Iterator itr = tidMap.entrySet().iterator();
        while (itr.hasNext()) {
            Throwable ex = null;
            Map.Entry entry = (Map.Entry)itr.next();
            Object key = entry.getKey();
            TransactionState value = (TransactionState)entry.getValue();
            byte[] cData = null;
            try {
                cData = ((PHashMapMMF)tidMap).getClientData(key);
                if (cData != null && cData.length > 0) {
                    int state = (int)cData[0]; // 1st byte is the modified state
                    value.setState(state);     // update txn state
                }
            } catch (Throwable e) {
                ex = e;
            }

            if (ex != null) {
                PHashMapLoadException le = new PHashMapLoadException(
                    "Failed to load client data [cData=" + cData + "]");
                le.setKey(key);
                le.setValue(value);
                le.setNextException(loadException);
                le.initCause(ex);
                loadException = le;
            }
        }

        if (loadException != null) {
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.util.PHashMapLoadException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.