private void internalClose() { // We close the underlying transport connection getTransportConnection().close(); for (Channel channel : channels.values()) { channel.close(); } }
transportConnection.close(); } catch (Throwable t) {
public void disconnect(final String connectionID) { if (!started) { return; } Connection conn = connections.get(connectionID); if (conn != null) { conn.close(); } }
public void disconnect(final String connectionID) { if (!started) { return; } Connection conn = connections.get(connectionID); if (conn != null) { conn.close(); } }
private void shutdown(boolean fail) { if (fail) { transportConnection.forceClose(); } else { transportConnection.close(); } }
private void internalClose() { // We close the underlying transport connection getTransportConnection().close(); }
private void internalClose() { // We close the underlying transport connection getTransportConnection().close(); }
private void internalClose() { // We close the underlying transport connection getTransportConnection().close(); for (Channel channel : channels.values()) { channel.close(); } }
private void internalClose() { // We close the underlying transport connection getTransportConnection().close(); for (Channel channel : channels.values()) { channel.close(); } }
private void internalClose() { // We close the underlying transport connection getTransportConnection().close(); for (Channel channel : channels.values()) { channel.close(); } }
private void internalClose() { // We close the underlying transport connection getTransportConnection().close(); for (Channel channel : channels.values()) { channel.close(); } }
private void internalClose() { // We close the underlying transport connection getTransportConnection().close(); for (Channel channel : channels.values()) { channel.close(); } }
private void internalClose() { // We close the underlying transport connection getTransportConnection().close(); for (Channel channel : channels.values()) { channel.close(); } }
public void close() { try { if (registeredConnectionId.getAndSet(false)) { server.removeClientConnection(remoteContainerId); } connection.close(); amqpConnection.close(null); } finally { for (Transaction tx : transactions.values()) { try { tx.rollback(); } catch (Exception e) { logger.warn(e.getMessage(), e); } } } }
public void close() { try { if (registeredConnectionId.getAndSet(false)) { server.removeClientConnection(remoteContainerId); } connection.close(); amqpConnection.close(null); } finally { for (Transaction tx : transactions.values()) { try { tx.rollback(); } catch (Exception e) { logger.warn(e.getMessage(), e); } } } }
private void internalClose() { if (frameHandler != null) { frameHandler.disconnect(); } transportConnection.close(); manager.cleanup(this); synchronized (sendLock) { callClosingListeners(); } }
private void internalClose() { if (frameHandler != null) { frameHandler.disconnect(); } transportConnection.close(); manager.cleanup(this); synchronized (sendLock) { callClosingListeners(); } }
@Override public void disconnect(boolean criticalError) { ErrorCondition errorCondition = new ErrorCondition(); errorCondition.setCondition(AmqpSupport.CONNECTION_FORCED); amqpConnection.close(errorCondition); getTransportConnection().close(); }
public void close(ErrorCondition errorCondition, AMQPConnectionContext connectionContext) { runNow(() -> { if (errorCondition != null) { connection.setCondition(errorCondition); } connection.close(); flush(); }); /*try { Thread.sleep(1000); } catch (Exception e) { e.printStackTrace(); } */ // this needs to be done in two steps // we first flush what we have to the client // after flushed, we close the local connection // otherwise this could close the netty connection before the Writable is complete runLater(() -> { connectionContext.getConnectionCallback().getTransportConnection().close(); }); }
/** * that java system properties are read */ @Test public void testJavaSystemProperty() throws Exception { BufferHandler handler = new BufferHandler() { @Override public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) { } }; System.setProperty(NettyConnector.JAVAX_KEYSTORE_PATH_PROP_NAME, "openssl-client-side-keystore.jks"); System.setProperty(NettyConnector.JAVAX_KEYSTORE_PASSWORD_PROP_NAME, "secureexample"); System.setProperty(NettyConnector.JAVAX_TRUSTSTORE_PATH_PROP_NAME, "openssl-client-side-truststore.jks"); System.setProperty(NettyConnector.JAVAX_TRUSTSTORE_PASSWORD_PROP_NAME, "secureexample"); Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); NettyConnector connector = new NettyConnector(params, handler, listener, executorService, Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newScheduledThreadPool(5, ActiveMQThreadFactory.defaultThreadFactory())); connector.start(); Assert.assertTrue(connector.isStarted()); Connection c = connector.createConnection(); assertNotNull(c); c.close(); connector.close(); Assert.assertFalse(connector.isStarted()); }