/* 693 */ if (trace)
/* 694 */ log.trace("Using a non-XA TopicConnection. It will not be able to participate in a Global UOW");
/* */ }
/* */ else
/* */ {
/* 698 */ throw new JBossResourceException("Connection was not recognizable: " + this.con);
/* */ }
/* 700 */ if (trace)
/* 701 */ log.trace("xaTopicSession=" + this.xaTopicSession + ", topicSession=" + this.topicSession);
/* */ }
/* 703 */ else if (this.info.getType() == 1)
/* */ {
/* 705 */ String jndi = adapter.getQueueFactoryRef();
/* 706 */ if (jndi == null)
/* 707 */ throw new IllegalStateException("No configured 'QueueFactoryRef' on the jms provider " + this.mcf.getJmsProviderAdapterJNDI());
/* 708 */ Object factory = context.lookup(jndi);
/* 709 */ this.con = ConnectionFactoryHelper.createQueueConnection(factory, this.user, this.pwd);
/* 710 */ if (this.info.getClientID() != null)
/* 711 */ this.con.setClientID(this.info.getClientID());
/* 712 */ this.con.setExceptionListener(this);
/* 713 */ if (trace) {
/* 714 */ log.debug("created connection: " + this.con);
/* */ }
/* 716 */ if ((this.con instanceof XAQueueConnection))
/* */ {
/* 718 */ this.xaQueueSession = ((XAQueueConnection)this.con).createXAQueueSession();
/* */
/* 720 */ this.queueSession = this.xaQueueSession.getQueueSession();
/* 721 */ this.xaTransacted = true;
/* */ }
/* 723 */ else if ((this.con instanceof QueueConnection))
/* */ {
/* 725 */ this.queueSession = ((QueueConnection)this.con).createQueueSession(transacted, ack);
/* */
/* 727 */ if (trace)
/* 728 */ log.trace("Using a non-XA QueueConnection. It will not be able to participate in a Global UOW");
/* */ }
/* */ else
/* */ {
/* 732 */ throw new JBossResourceException("Connection was not reconizable: " + this.con);
/* */ }
/* 734 */ if (trace)
/* 735 */ log.trace("xaQueueSession=" + this.xaQueueSession + ", queueSession=" + this.queueSession);
/* */ }
/* */ else
/* */ {
/* 739 */ String jndi = adapter.getFactoryRef();
/* 740 */ if (jndi == null)
/* 741 */ throw new IllegalStateException("No configured 'FactoryRef' on the jms provider " + this.mcf.getJmsProviderAdapterJNDI());
/* 742 */ Object factory = context.lookup(jndi);
/* 743 */ this.con = ConnectionFactoryHelper.createConnection(factory, this.user, this.pwd);
/* 744 */ if (this.info.getClientID() != null)
/* 745 */ this.con.setClientID(this.info.getClientID());
/* 746 */ this.con.setExceptionListener(this);
/* 747 */ if (trace) {
/* 748 */ log.trace("created connection: " + this.con);
/* */ }
/* 750 */ if ((this.con instanceof XAConnection))
/* */ {
/* 752 */ this.xaSession = ((XAConnection)this.con).createXASession();
/* */
/* 754 */ this.session = this.xaSession.getSession();
/* 755 */ this.xaTransacted = true;
/* */ }
/* */ else
/* */ {
/* 759 */ this.session = this.con.createSession(transacted, ack);
/* 760 */ if (trace) {
/* 761 */ log.trace("Using a non-XA Connection. It will not be able to participate in a Global UOW");
/* */ }
/* */ }
/* */
/* 765 */ if (trace) {
/* 766 */ log.debug("xaSession=" + this.xaQueueSession + ", Session=" + this.session);
/* */ }
/* */ }
/* 769 */ if (trace)
/* 770 */ log.debug("transacted=" + transacted + ", ack=" + ack);
/* */ }
/* */ catch (NamingException e)
/* */ {
/* 774 */ throw new JBossResourceException("Unable to setup connection", e);
/* */ }
/* */ catch (JMSException e)
/* */ {
/* 778 */ throw new JBossResourceException("Unable to setup connection", e);
/* */ }
/* */ }