use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class ActiveMQConnectionFactory method createActiveMQConnection.
protected ActiveMQConnection createActiveMQConnection(String userName, String password) throws JMSException {
if (brokerURL == null) {
throw new ConfigurationException("brokerURL not set.");
}
ActiveMQConnection connection = null;
try {
Transport transport = createTransport();
connection = createActiveMQConnection(transport, factoryStats);
connection.setUserName(userName);
connection.setPassword(password);
configureConnection(connection);
transport.start();
if (clientID != null) {
connection.setDefaultClientID(clientID);
}
return connection;
} catch (JMSException e) {
// Clean up!
try {
connection.close();
} catch (Throwable ignore) {
}
throw e;
} catch (Exception e) {
// Clean up!
try {
connection.close();
} catch (Throwable ignore) {
}
throw JMSExceptionSupport.create("Could not connect to broker URL: " + brokerURL + ". Reason: " + e, e);
}
}
use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class NetworkTestSupport method createRemoteConnection.
protected StubConnection createRemoteConnection() throws Exception {
Transport transport = TransportFactory.connect(remoteConnector.getServer().getConnectURI());
StubConnection connection = new StubConnection(transport);
connections.add(connection);
return connection;
}
use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class NetworkTestSupport method createConnection.
@Override
protected StubConnection createConnection() throws Exception {
Transport transport = TransportFactory.connect(connector.getServer().getConnectURI());
StubConnection connection = new StubConnection(transport);
connections.add(connection);
return connection;
}
use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class BrokerNetworkWithStuckMessagesTest method createSecondRemoteConnection.
protected StubConnection createSecondRemoteConnection() throws Exception {
Transport transport = TransportFactory.connect(secondRemoteConnector.getServer().getConnectURI());
StubConnection connection = new StubConnection(transport);
connections.add(connection);
return connection;
}
use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class BrokerNetworkWithStuckMessagesTest method createConnection.
protected StubConnection createConnection() throws Exception {
Transport transport = TransportFactory.connect(connector.getServer().getConnectURI());
StubConnection connection = new StubConnection(transport);
connections.add(connection);
return connection;
}
Aggregations