protected javax.jms.Topic createRemoteTopic(final JMSSpecificContext context, final String name) { return (javax.jms.Topic) DestinationUtil.mightThrow(new Callable() { @Override public Object call() throws Exception { return context.jmsSession().createTopic(name); } }); }
@Override public void acknowledge() { if (this.latestMessage != null) { DestinationUtil.mightThrow(new Callable() { @Override public Object call() throws Exception { JMSContext.this.latestMessage.jmsMessage().acknowledge(); return null; } }); } }
protected javax.jms.Queue createRemoteQueue(final JMSSpecificContext context, final String name) { return (javax.jms.Queue) DestinationUtil.mightThrow(new Callable() { @Override public Object call() throws Exception { return context.jmsSession().createQueue(name); } }); }
@Override public void commit() { if (isTransacted()) { DestinationUtil.mightThrow(new Callable() { @Override public Object call() throws Exception { jmsSession().commit(); return null; } }); } }
@Override public void rollback() { if (isTransacted()) { DestinationUtil.mightThrow(new Callable() { @Override public Object call() throws Exception { jmsSession().rollback(); return null; } }); } }
@Override public Session jmsSession() { if (this.jmsSession == null) { this.jmsSession = (Session) DestinationUtil.mightThrow(new Callable() { @Override public Object call() throws Exception { jmsConnection.start(); return createJMSSession(); } }); addCloseable(this.jmsSession); } return this.jmsSession; }
protected JMSSpecificContext createXAContext(final XAConnectionFactory cf, final Options<CreateContextOption> options) { if (TransactionUtil.tm == null) { throw new NullPointerException("TransactionManager not found; is transactions module on the classpath?"); } XAConnection connection = (XAConnection) DestinationUtil.mightThrow(new Callable() { @Override public Object call() throws Exception { if (options.has(CreateContextOption.USERNAME)) { return cf.createXAConnection(options.getString(CreateContextOption.USERNAME), options.getString(CreateContextOption.PASSWORD)); } else { return cf.createXAConnection(); } } }); return new JMSXAContext(connection, this, (Context.Mode)options.get(CreateContextOption.MODE), options.has(CreateContextOption.HOST)); }
protected JMSSpecificContext createContext(final ConnectionFactory cf, final Options<CreateContextOption> options) { Connection connection = (Connection) DestinationUtil.mightThrow(new Callable() { @Override public Object call() throws Exception { Connection connection; if (options.has(CreateContextOption.USERNAME)) { connection = cf.createConnection(options.getString(CreateContextOption.USERNAME), options.getString(CreateContextOption.PASSWORD)); } else { connection = cf.createConnection(); } return connection; } }); return new JMSContext(connection, this, (Context.Mode)options.get(CreateContextOption.MODE), options.has(CreateContextOption.HOST)); }