String graphAffinity = pathComponents[2]; request.getRequest().getConnection() .addCloseListener((closeable, iCloseType) -> { broker.removeSuspendedResponse(graphAffinity, response); }); .addCloseListener((closeable, iCloseType) -> { broker.deletePriorityTask(task.taskId); }); request.getRequest().getConnection().addCloseListener((c, i) -> { broker.removeSinglePointChannel(graphAffinity, wr); });
@Override public void addCloseListener(final CloseListener closeListener) { final org.glassfish.tyrus.websockets.Connection webSocketConnection = this; connection.addCloseListener(new org.glassfish.grizzly.CloseListener() { @Override public void onClosed(Closeable closeable, ICloseType iCloseType) throws IOException { closeListener.onClose(webSocketConnection); } }); }
@Override public void onConnectionAcceptEvent(Connection connection) { keepAliveConnectionsCount.incrementAndGet(); connection.addCloseListener(new GenericCloseListener() { @Override public void onClosed(final Closeable closeable, final CloseType closeType) throws IOException { keepAliveConnectionsCount.decrementAndGet(); } }); }
void register(final Connection connection) { if (connections.putIfAbsent(connection, System.currentTimeMillis()) == null) { connection.addCloseListener(closeListener); if (isClosed.get()) { connection.close(); } } }
void register(final Connection connection) { if (connections.putIfAbsent(connection, System.currentTimeMillis()) == null) { connection.addCloseListener(closeListener); if (isClosed.get()) { connection.close(); } } }
static void set(final Connection c, final HttpTransactionContext httpTxContext) { c.addCloseListener(httpTxContext.listener); REQUEST_STATE_ATTR.set(c, httpTxContext); }
public void offer(final Connection connection) { final SocketAddress remoteAddress = (SocketAddress) connection.getPeerAddress(); final CacheRecord cacheRecord = obtainCacheRecord(remoteAddress); final int totalConnectionsN = totalCachedConnectionsCount.incrementAndGet(); final int parallelConnectionN = cacheRecord.idleConnectionsCount.incrementAndGet(); if (totalConnectionsN > highWaterMark || parallelConnectionN > maxParallelConnections) { totalCachedConnectionsCount.decrementAndGet(); cacheRecord.idleConnectionsCount.decrementAndGet(); } connection.addCloseListener(removeCachedConnectionOnCloseListener); cacheRecord.connections.offer(connection); if (isClosed.get()) { // remove cache entry associated with the remoteAddress (only if we have the actual value) cache.remove(remoteAddress, cacheRecord); closeCacheRecord(cacheRecord); } }
/** * The method attaches {@link Connection} to the pool. */ ConnectionInfo<E> attach0(final Connection connection) { poolSize++; final ConnectionInfo<E> info = new ConnectionInfo<E>(connection, this); connectionsMap.put(connection, info); if (connectionTTLMillis >= 0) { connectionTTLQueue.add(info, connectionTTLMillis, TimeUnit.MILLISECONDS); } connection.addCloseListener(closeListener); return info; }
public void offer(final Connection connection) { final SocketAddress remoteAddress = (SocketAddress) connection.getPeerAddress(); final CacheRecord cacheRecord = obtainCacheRecord(remoteAddress); final int totalConnectionsN = totalCachedConnectionsCount.incrementAndGet(); final int parallelConnectionN = cacheRecord.idleConnectionsCount.incrementAndGet(); if (totalConnectionsN > highWaterMark || parallelConnectionN > maxParallelConnections) { totalCachedConnectionsCount.decrementAndGet(); cacheRecord.idleConnectionsCount.decrementAndGet(); } connection.addCloseListener(removeCachedConnectionOnCloseListener); cacheRecord.connections.offer(connection); if (isClosed.get()) { // remove cache entry associated with the remoteAddress (only if we have the actual value) cache.remove(remoteAddress, cacheRecord); closeCacheRecord(cacheRecord); } }
/** * The method attaches {@link Connection} to the pool. */ ConnectionInfo<E> attach0(final Connection connection) { poolSize++; final ConnectionInfo<E> info = new ConnectionInfo<E>(connection, this); connectionsMap.put(connection, info); if (connectionTTLMillis >= 0) { connectionTTLQueue.add(info, connectionTTLMillis, TimeUnit.MILLISECONDS); } connection.addCloseListener(closeListener); return info; }
@Override public void onConnectionAcceptEvent(final Connection connection) { grizzlyMonitoring.getKeepAliveProbeProvider().incrementCountConnectionsEvent(monitoringId); connection.addCloseListener(new Connection.CloseListener() { @Override public void onClosed(final Connection connection, Connection.CloseType closeType) throws IOException { grizzlyMonitoring.getKeepAliveProbeProvider().decrementCountConnectionsEvent(monitoringId); } }); }
public void completed(Connection connection) { future.setConnection(connection); provider.touchConnection(connection, request); if (wrappedHandler != null) { connection.addCloseListener(connectionMonitor); wrappedHandler.completed(connection); } }
connection.addCloseListener(closeListener);
connection.addCloseListener(closeListener);
connection.addCloseListener(closeListener);
connection.addCloseListener(closeListener);
connection.addCloseListener(closeListener);
connection.addCloseListener(closeListener);
connection.addCloseListener(closeListener);
connection.addCloseListener(closeListener);