Package com.sun.messaging.bridge.service.jms.tx

Examples of com.sun.messaging.bridge.service.jms.tx.TransactionManagerAdapter


        Map<String, LinkElement> elinks = _jmsbridge.getLinks();
        for (Map.Entry<String, LinkElement> pair: elinks.entrySet()) {
            xa |= createLink(pair.getValue(), _jmsbridge);
        }
        if (xa) {
            TransactionManagerAdapter tma = getTransactionManagerAdapter();

            if (tma.registerRM()) {

                Map<String, XAConnectionFactoryImpl> xacfs =
                    new LinkedHashMap<String, XAConnectionFactoryImpl>((Map)_localXACFs);

                for (Map.Entry<String, Object> pair: _allCF.entrySet()) {
View Full Code Here


        return _supportTransactionTimeout;
    }

    private void registerXAResources(Map<String, ? extends Object> cfs) throws Exception {

        TransactionManagerAdapter tma = getTransactionManagerAdapter();
        if (!tma.registerRM()) return;

        String cfref = null;
        Object cf = null;
        XAConnection conn = null;
        for (Map.Entry<String, ? extends Object> pair: cfs.entrySet()) {
            cfref = pair.getKey();
            cf = pair.getValue();
            if (!(cf instanceof XAConnectionFactory)) continue;
            if (((Refable)cf).isMultiRM()) {
                _logger.log(Level.INFO,  _jbr.getString(_jbr.I_SKIP_REGISTER_MULTIRM_CF,
                                         JMSBridgeXMLConstant.CF.MULTIRM, cfref.toString()));
                continue;
            }

            XAResource xar = null;
            EventListener l = new EventListener(this);
            try {
                 String username = _jmsbridge.getCF(((Refable)cf).getRef()).getUsername();
                 String password = _jmsbridge.getCF(((Refable)cf).getRef()).getPassword();
                _notifier.addEventListener(EventListener.EventType.BRIDGE_STOP, l);
                conn = (XAConnection)openConnection(cf, 1, 0, username, password, "", this, l, _logger);
                XASession ss = conn.createXASession();
                xar = ss.getXAResource();
                _logger.log(Level.INFO, _jbr.getString(_jbr.I_REGISTER_RM, cfref.toString(), xar.toString()));
                tma.registerRM(cfref, xar);
            } catch (Throwable  t) {
                _logger.log(Level.WARNING, _jbr.getKString(
                        _jbr.W_REGISTER_RM_ATTEMPT_FAILED, cfref.toString(), (xar == null ? "":xar.toString())), t);
            } finally {
                _notifier.removeEventListener(l);
View Full Code Here

TOP

Related Classes of com.sun.messaging.bridge.service.jms.tx.TransactionManagerAdapter

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.