Example usage for javax.jms IllegalStateException initCause

List of usage examples for javax.jms IllegalStateException initCause

Introduction

In this page you can find the example usage for javax.jms IllegalStateException initCause.

Prototype

public synchronized Throwable initCause(Throwable cause) 

Source Link

Document

Initializes the cause of this throwable to the specified value.

Usage

From source file:org.apache.activemq.jms.pool.ConnectionPool.java

public Session createSession(boolean transacted, int ackMode) throws JMSException {
    SessionKey key = new SessionKey(transacted, ackMode);
    PooledSession session;//from   ww w  .  j a v a 2s. co m
    try {
        session = new PooledSession(key, sessionPool.borrowObject(key), sessionPool, key.isTransacted(),
                useAnonymousProducers);
        session.addSessionEventListener(new PooledSessionEventListener() {

            @Override
            public void onTemporaryTopicCreate(TemporaryTopic tempTopic) {
            }

            @Override
            public void onTemporaryQueueCreate(TemporaryQueue tempQueue) {
            }

            @Override
            public void onSessionClosed(PooledSession session) {
                ConnectionPool.this.loanedSessions.remove(session);
            }
        });
        this.loanedSessions.add(session);
    } catch (Exception e) {
        IllegalStateException illegalStateException = new IllegalStateException(e.toString());
        illegalStateException.initCause(e);
        throw illegalStateException;
    }
    return session;
}

From source file:org.apache.aries.transaction.jms.internal.ConnectionPool.java

public Session createSession(boolean transacted, int ackMode) throws JMSException {
    SessionKey key = new SessionKey(transacted, ackMode);
    PooledSession session;//from   w w  w  .j a  v a2 s . co  m
    try {
        session = sessionPool.borrowObject(key);
    } catch (Exception e) {
        javax.jms.IllegalStateException illegalStateException = new IllegalStateException(e.toString());
        illegalStateException.initCause(e);
        throw illegalStateException;
    }
    return session;
}

From source file:org.apache.karaf.jms.pool.internal.ConnectionPool.java

public Session createSession(boolean transacted, int ackMode) throws JMSException {
    SessionKey key = new SessionKey(transacted, ackMode);
    PooledSession session;// www  . java 2  s.  co m
    try {
        session = sessionPool.borrowObject(key);
    } catch (Exception e) {
        IllegalStateException illegalStateException = new IllegalStateException(e.toString());
        illegalStateException.initCause(e);
        throw illegalStateException;
    }
    return session;
}