@Override public TopicSession getTopicSession() throws JMSException { if ((types & TYPE_XA_TOPIC) != TYPE_XA_TOPIC) { throw new IllegalStateException(delegate + " is not an XATopicSession"); } TopicSession xats = ((XATopicSession) delegate).getTopicSession(); return TracingSession.create(xats, jmsTracing); } }
xares = xats.getXAResource(); try { tx.enlistResource(this.getXAResource()); return xats.getTopicSession();
@Override public XAResource getXAResource() { return xaTopicSession.getXAResource(); }
protected void MOMSessionClose() { try { if (xats != null) { xats.close(); xats = null; } if (ts != null) { ts.close(); ts = null; jconn.sessionClose(this); } } catch (JMSException e) { TraceJms.logger.log(BasicLevel.ERROR,"exception:"+e); } }
@Override public Session getSession() throws JMSException { return addSession(xaTopicSession.getSession()); }
/** * Get the XAResource for the connection. * * @return The XAResource for the connection. * * @throws ResourceException XA transaction not supported */ public XAResource getXAResource() throws ResourceException { // // Spec says a mc must allways return the same XA resource, // so we cache it. // if (!xaTransacted) throw new NotSupportedException("Non XA transaction not supported"); if (xaResource == null) { if (info.getType() == JmsConnectionFactory.TOPIC) xaResource = xaTopicSession.getXAResource(); else if (info.getType() == JmsConnectionFactory.QUEUE) xaResource = xaQueueSession.getXAResource(); else xaResource = xaSession.getXAResource(); } if (log.isTraceEnabled()) log.trace("XAResource=" + xaResource); xaResource = new JmsXAResource(this, xaResource); return xaResource; }
topicSession.close(); if (xaTransacted && xaTopicSession != null) { xaTopicSession.close();
@Override public TopicSession getTopicSession() throws JMSException { return addSession(xaTopicSession.getTopicSession()); } }
@Override public TopicSession getTopicSession() throws JMSException { return addSession( ((XATopicSession) session).getTopicSession()); }
} else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) { xaSession = ((XATopicConnection) con).createXATopicSession(); session = ((XATopicSession)xaSession).getTopicSession(); } else { xaSession = ((XAConnection) con).createXASession();
topicSession = xaTopicSession.getTopicSession(); xaTransacted = true;