Example usage for javax.jms XASession setMessageListener

List of usage examples for javax.jms XASession setMessageListener

Introduction

In this page you can find the example usage for javax.jms XASession setMessageListener.

Prototype

void setMessageListener(MessageListener listener) throws JMSException;

Source Link

Document

Sets the session's distinguished message listener (optional).

Usage

From source file:org.soulwing.oaq.ServerSessionFactory.java

/**
 * {@inheritDoc}/*from w  w w  . j a va  2  s. c o m*/
 */
@Override
public ServerSession makeObject() throws JMSException, UnavailableException {
    Validate.notNull(getSessionPool());
    Validate.notNull(getConnection());
    XASession session = getConnection().createXASession();
    XAResource resource = session.getXAResource();
    MessageEndpointProxy endpoint = new MessageEndpointProxy(
            details.getEndpointFactory().createEndpoint(resource));
    session.setMessageListener(endpoint);
    return new ServerSessionWork(session, details.getWorkManager(), getSessionPool());
}