use of com.axway.ats.action.jms.model.connections.ManagedConnection in project ats-framework by Axway.
the class JmsClient method shutdown.
/**
* Shutdown the JMS client.
* This closes all connections and sessions.
*/
@PublicAtsApi
public synchronized void shutdown() {
releaseSession(true);
releaseConnection();
for (final ManagedConnection connection : connections) {
connection.shutdown();
}
connections.clear();
}
use of com.axway.ats.action.jms.model.connections.ManagedConnection in project ats-framework by Axway.
the class JmsClient method doConnect.
private synchronized ManagedConnection doConnect() {
releaseConnection();
final ManagedConnection connection = createManagedConnection();
try {
connection.start();
} catch (JMSException e) {
connection.shutdown();
throw new JmsMessageException("Error starting JMS connection from connection factory '" + defaultConnectionFactoryName + "'", e);
}
this.connection = connection;
return connection;
}
use of com.axway.ats.action.jms.model.connections.ManagedConnection in project ats-framework by Axway.
the class JmsClient method createManagedConnection.
private ManagedConnection createManagedConnection() {
final ManagedConnection connection;
final ConnectionFactory connectionFactory = getConnectionFactory();
try {
if (!StringUtils.isNullOrEmpty(this.username)) {
connection = ManagedConnection.create(connectionFactory.createConnection(this.username, this.password));
} else {
connection = ManagedConnection.create(connectionFactory.createConnection());
}
} catch (JMSException e) {
throw new JmsMessageException("Error creating JMS connection from connection factory '" + defaultConnectionFactoryName + "'", e);
}
return connection;
}
Aggregations