use of jakarta.jms.ConnectionFactory in project spring-framework by spring-projects.
the class SingleConnectionFactory method obtainTargetConnectionFactory.
private ConnectionFactory obtainTargetConnectionFactory() {
ConnectionFactory target = getTargetConnectionFactory();
Assert.state(target != null, "'targetConnectionFactory' is required");
return target;
}
use of jakarta.jms.ConnectionFactory in project spring-framework by spring-projects.
the class JmsAccessor method obtainConnectionFactory.
/**
* Obtain the ConnectionFactory for actual use.
* @return the ConnectionFactory (never {@code null})
* @throws IllegalStateException in case of no ConnectionFactory set
* @since 5.0
*/
protected final ConnectionFactory obtainConnectionFactory() {
ConnectionFactory connectionFactory = getConnectionFactory();
Assert.state(connectionFactory != null, "No ConnectionFactory set");
return connectionFactory;
}
use of jakarta.jms.ConnectionFactory in project spring-framework by spring-projects.
the class TransactionAwareConnectionFactoryProxy method getTargetConnectionFactory.
/**
* Return the target ConnectionFactory that this ConnectionFactory should delegate to.
*/
protected ConnectionFactory getTargetConnectionFactory() {
ConnectionFactory target = this.targetConnectionFactory;
Assert.state(target != null, "'targetConnectionFactory' is required");
return target;
}
use of jakarta.jms.ConnectionFactory in project spring-framework by spring-projects.
the class TransactionAwareConnectionFactoryProxy method createQueueConnection.
@Override
public QueueConnection createQueueConnection() throws JMSException {
ConnectionFactory target = getTargetConnectionFactory();
if (!(target instanceof QueueConnectionFactory)) {
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is no QueueConnectionFactory");
}
QueueConnection targetConnection = ((QueueConnectionFactory) target).createQueueConnection();
return (QueueConnection) getTransactionAwareConnectionProxy(targetConnection);
}
use of jakarta.jms.ConnectionFactory in project spring-framework by spring-projects.
the class TransactionAwareConnectionFactoryProxy method createTopicConnection.
@Override
public TopicConnection createTopicConnection() throws JMSException {
ConnectionFactory target = getTargetConnectionFactory();
if (!(target instanceof TopicConnectionFactory)) {
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is no TopicConnectionFactory");
}
TopicConnection targetConnection = ((TopicConnectionFactory) target).createTopicConnection();
return (TopicConnection) getTransactionAwareConnectionProxy(targetConnection);
}
Aggregations