public void onClose(Connection connection) { for (ConnectionListener delegate : this.delegates) { delegate.onClose(connection); } }
public void onCreate(Connection connection) { for (ConnectionListener delegate : this.delegates) { delegate.onCreate(connection); } }
@Override public void onShutDown(ShutdownSignalException signal) { for (ConnectionListener delegate : this.delegates) { delegate.onShutDown(signal); } }
public void onCreate(Connection connection) { for (ConnectionListener delegate : this.delegates) { delegate.onCreate(connection); } }
public void onClose(Connection connection) { for (ConnectionListener delegate : this.delegates) { delegate.onClose(connection); } }
@Override public void onShutDown(ShutdownSignalException signal) { for (ConnectionListener delegate : this.delegates) { delegate.onShutDown(signal); } }
@Override public void addConnectionListener(ConnectionListener listener) { super.addConnectionListener(listener); // handles publishing sub-factory // If the connection is already alive we assume that the new listener wants to be notified if (this.connection.target != null) { listener.onCreate(this.connection); } }
private void notifyCloseIfNecessary() { if (!(this.closeNotified.getAndSet(true))) { getConnectionListener().onClose(this); } }
@Override public void shutdownCompleted(ShutdownSignalException cause) { this.closeExceptionLogger.log(logger, "Channel shutdown", cause); int protocolClassId = cause.getReason().protocolClassId(); if (protocolClassId == RabbitUtils.CHANNEL_PROTOCOL_CLASS_ID_20) { getChannelListener().onShutDown(cause); } else if (protocolClassId == RabbitUtils.CONNECTION_PROTOCOL_CLASS_ID_10) { getConnectionListener().onShutDown(cause); } }
@Override public void addConnectionListener(ConnectionListener listener) { super.addConnectionListener(listener); // handles publishing sub-factory // If the connection is already alive we assume that the new listener wants to be notified if (this.connection.target != null) { listener.onCreate(this.connection); } }
private void notifyCloseIfNecessary() { if (!(this.closeNotified.getAndSet(true))) { getConnectionListener().onClose(this); } }
@Override public void shutdownCompleted(ShutdownSignalException cause) { this.closeExceptionLogger.log(logger, "Channel shutdown", cause); int protocolClassId = cause.getReason().protocolClassId(); if (protocolClassId == RabbitUtils.CHANNEL_PROTOCOL_CLASS_ID_20) { getChannelListener().onShutDown(cause); } else if (protocolClassId == RabbitUtils.CONNECTION_PROTOCOL_CLASS_ID_10) { getConnectionListener().onShutDown(cause); } }
private void refreshProxyConnection(ChannelCachingConnectionProxy connection) { connection.destroy(); connection.notifyCloseIfNecessary(); connection.target = super.createBareConnection(); connection.closeNotified.set(false); getConnectionListener().onCreate(connection); if (logger.isDebugEnabled()) { logger.debug("Refreshed existing connection '" + connection + "'"); } }
public void destroy() { if (this.target != null) { getConnectionListener().onClose(target); RabbitUtils.closeConnection(this.target); } this.target = null; }
private void refreshProxyConnection(ChannelCachingConnectionProxy connection) { connection.destroy(); connection.notifyCloseIfNecessary(); connection.target = super.createBareConnection(); connection.closeNotified.set(false); getConnectionListener().onCreate(connection); if (logger.isDebugEnabled()) { logger.debug("Refreshed existing connection '" + connection + "'"); } }
@Override public void setConnectionListeners(List<? extends ConnectionListener> listeners) { super.setConnectionListeners(listeners); // handles publishing sub-factory // If the connection is already alive we assume that the new listeners want to be notified if (this.connection.target != null) { this.getConnectionListener().onCreate(this.connection); } }
@Override public void setConnectionListeners(List<? extends ConnectionListener> listeners) { super.setConnectionListeners(listeners); // handles publishing sub-factory // If the connection is already alive we assume that the new listeners want to be notified if (this.connection.target != null) { this.getConnectionListener().onCreate(this.connection); } }
@Override public void addConnectionListener(ConnectionListener listener) { super.addConnectionListener(listener); // If the connection is already alive we assume that the new listener wants to be notified if (this.connection != null) { listener.onCreate(this.connection); } }
@Override public final Connection createConnection() throws AmqpException { if (this.stopped) { throw new AmqpApplicationContextClosedException( "The ApplicationContext is closed and the ConnectionFactory can no longer create connections."); } synchronized (this.connectionMonitor) { if (this.cacheMode == CacheMode.CHANNEL) { if (this.connection.target == null) { this.connection.target = super.createBareConnection(); // invoke the listener *after* this.connection is assigned if (!this.checkoutPermits.containsKey(this.connection)) { this.checkoutPermits.put(this.connection, new Semaphore(this.channelCacheSize)); } this.connection.closeNotified.set(false); getConnectionListener().onCreate(this.connection); } return this.connection; } else if (this.cacheMode == CacheMode.CONNECTION) { return connectionFromCache(); } } return null; // NOSONAR - never reach here - exceptions }
@Override public final Connection createConnection() throws AmqpException { if (this.stopped) { throw new AmqpApplicationContextClosedException( "The ApplicationContext is closed and the ConnectionFactory can no longer create connections."); } synchronized (this.connectionMonitor) { if (this.cacheMode == CacheMode.CHANNEL) { if (this.connection.target == null) { this.connection.target = super.createBareConnection(); // invoke the listener *after* this.connection is assigned if (!this.checkoutPermits.containsKey(this.connection)) { this.checkoutPermits.put(this.connection, new Semaphore(this.channelCacheSize)); } this.connection.closeNotified.set(false); getConnectionListener().onCreate(this.connection); } return this.connection; } else if (this.cacheMode == CacheMode.CONNECTION) { return connectionFromCache(); } } return null; // NOSONAR - never reach here - exceptions }