Example usage for javax.jms XAConnection start

List of usage examples for javax.jms XAConnection start

Introduction

In this page you can find the example usage for javax.jms XAConnection start.

Prototype


void start() throws JMSException;

Source Link

Document

Starts (or restarts) a connection's delivery of incoming messages.

Usage

From source file:org.codehaus.stomp.jms.ProtocolConverter.java

protected StompSession getXASession(Xid xid) throws JMSException {
    StompSession xaSession = xaSessions.get(xid);
    if (xaSession == null) {

        XAConnection xaConnection;
        if (login != null) {
            xaConnection = xaConnectionFactory.createXAConnection(login, passcode);
        } else {//from   www. j a  v a  2 s . com
            xaConnection = xaConnectionFactory.createXAConnection();
        }
        if (clientId != null) {
            xaConnection.setClientID(clientId);
        }
        xaConnection.start();
        Session session = xaConnection.createXASession();
        if (log.isDebugEnabled()) {
            log.debug("Created XA session");
        }
        xaSession = new StompSession(initialContext, this, session, xaConnection);
        log.trace("Created XA Session");
        xaSessions.put(xid, xaSession);
    } else {
        log.trace("Returned existing XA session");
    }
    return xaSession;
}