Informs this {@link CommandTransferServer} that a client connection got closed.

@param connection The connection that was closed
976480
void connectionCloses(final SynchronizeFXTomcatConnection connection) {
        LOG.info("Client connection closed.");
        synchronized (connections) {
            final ExecutorService executorService = connectionThreads.get(connection);
            if (executorService != null) {
                executorService.shutdown();
            }
            connectionThreads.remove(connection);
            connections.remove(connection);
        }
    }
337399
protected void checkClosed() throws JMSException {
        if (getState() == CLOSED) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "This Connection is closed.");
            throw (javax.jms.IllegalStateException) JmsErrorUtils.newThrowable(javax.jms.IllegalStateException.class,
                                                                               "CONNECTION_CLOSED_CWSIA0021",
                                                                               null, tc);
        }
    }
1306343
protected void closeLocalConnection(Connection connection) {
    try {
      if (connection != null && !connection.isClosed()) {
        connection.close();
      }
    } catch (SQLException e) {
      if (logger.isTraceEnabled()) {
        logger.trace(e.getMessage());
      }
    }
  }
1373723
public static void closeConnection(Connection conn){
		if (conn != null) {
			try {
				conn.close();
			} catch (Exception e) {
				log.warn("Exception when closing database connection.", e);
			}
		}
	}
2375
public static void closeQuietly(@Nullable Connection con) {
		try {
			close(con);
		} catch (SQLException e) {
			Loggers.get(Connections.class).log(SEVERE, "closing connection", e);
		}
	}
1132878
public static void closeClient(TServiceClient client) {
        if (client == null) {
            return;
        }
        try {
            TProtocol proto = client.getInputProtocol();
            if (proto != null) {
                proto.getTransport().close();
            }
        } catch (Throwable e) {
            logger.warn("close input transport fail", e);
        }
        try {
            TProtocol proto = client.getOutputProtocol();
            if (proto != null) {
                proto.getTransport().close();
            }
        } catch (Throwable e) {
            logger.warn("close output transport fail", e);
        }

    }
735750
static void rollback(Connection connection) {
        if (connection != null)
            try {
                connection.rollback();
                log.debug("rolled back");
            } catch (SQLException e) {
                throw new SQLRuntimeException(e);
            }
    }
1164356
@Override
  public void close(ChannelHandlerContext ctx, ChannelPromise future) throws Exception {
    Status status = Status.UNAVAILABLE.withDescription(
        "Connection closing while performing protocol negotiation for " + ctx.pipeline().names());
    failWrites(status.asRuntimeException());
    super.close(ctx, future);
  }
923818
final public void releaseConnection(C connection) throws E {
		// Find the associated PooledConnection
		PooledConnection<C> pooledConnection = null;
		List<PooledConnection<C>> threadConnections = currentThreadConnections.get();
		for(int c=threadConnections.size()-1; c>=0; c--) {
			PooledConnection<C> threadConnection = threadConnections.get(c);
			synchronized(threadConnection) {
				if(threadConnection.connection==connection) {
					pooledConnection = threadConnection;
					threadConnections.remove(c);
					break;
				}
			}
		}
		if(pooledConnection==null) {
			logger.log(Level.WARNING, "PooledConnection not found during releaseConnection");
		} else {
			try {
				boolean closeConnection = false;
				boolean connIsClosed;
				try {
					connIsClosed = isClosed(connection);
				} catch(Exception err) {
					logger.log(Level.SEVERE, null, err);
					connIsClosed = false;
					closeConnection = true; // Force closure due to error on isClosed
				}
				if(connIsClosed) {
					// Already closed
					synchronized(pooledConnection) {
						pooledConnection.connection = null;
					}
				} else {
					if(maxConnectionAge!=UNLIMITED_MAX_CONNECTION_AGE) {
						long age = System.currentTimeMillis()-pooledConnection.createTime;
						if(age<0 || age>=maxConnectionAge) closeConnection = true;
					}
					if(closeConnection) {
						// Error on isClosed or max age reached, close the connection
						try {
							close(connection);
						} catch(Exception err) {
							logger.log(Level.SEVERE, null, err);
						}
						synchronized(pooledConnection) {
							pooledConnection.connection = null;
						}
					} else {
						// Reset connections as they are released
						try {
							resetConnection(connection);
						} catch(Exception err) {
							// Close the connection when error during reset
							logger.log(Level.SEVERE, null, err);
							try {
								close(connection);
							} catch(Exception err2) {
								logger.log(Level.SEVERE, null, err2);
							}
							synchronized(pooledConnection) {
								pooledConnection.connection = null;
							}
						}
					}
				}
			} finally {
				// Unallocate the connection from the pool
				release(pooledConnection);
			}
		}
	}
148340
@Override
	public void close() {
		try {
			connection.close();
		} catch(IOException e) {
			log.log(Level.WARNING, "Could not close connection", e);
		}
	}
906587
public static void closeQuietly(final Connection connection)
    {
        if (connection != null) {
            try {
                connection.close();
            }
            catch (JMSException je) {
                if (je.getCause() instanceof InterruptedException) {
                    LOG.trace("ActiveMQ caught and wrapped InterruptedException");
                }
                if (je.getCause() instanceof InterruptedIOException) {
                    LOG.trace("ActiveMQ caught and wrapped InterruptedIOException");
                }
                else {
                    LOG.warnDebug(je, "While closing connection");
                }
            }
        }
    }
1028613
private void checkCloseConnection(ChannelFuture future) {
        // If this connection is closing and the graceful shutdown has completed, close the connection
        // once this operation completes.
        if (closeListener != null && isGracefulShutdownComplete()) {
            ChannelFutureListener closeListener = this.closeListener;
            // This method could be called multiple times
            // and we don't want to notify the closeListener multiple times.
            this.closeListener = null;
            try {
                closeListener.operationComplete(future);
            } catch (Exception e) {
                throw new IllegalStateException("Close listener threw an unexpected exception", e);
            }
        }
    }
1242701
@Override
    public boolean returnConnection(Connection<CL> connection) {
        returnedCount.incrementAndGet();
        monitor.incConnectionReturned(host);

        ConnectionException ce = connection.getLastException();
        if (ce != null) {
            if (ce instanceof IsDeadConnectionException) {
                noteError(ce);
                internalCloseConnection(connection);
                return true;
            }
        }
        errorsSinceLastSuccess.set(0);

        // Still within the number of max active connection
        if (activeCount.get() <= config.getMaxConnsPerHost()) {
            availableConnections.add(connection);

            if (isShutdown()) {
                discardIdleConnections();
                return true;
            }
        }
        else {
            // maxConnsPerHost was reduced. This may end up closing too many
            // connections, but that's ok. We'll open them later.
            internalCloseConnection(connection);
            return true;
        }

        return false;
    }
525473
protected void closeConnection(ThriftConnectionHandle<T> connection) {
		if (connection != null) {
			try {
				connection.internalClose();
			} catch (Throwable t) {
				logger.error("Destroy connection exception", t);
			} finally {
				this.thriftConnectionPool.postDestroyConnection(connection);
			}
		}
	}
514338
public void markServerDown(SuroConnection connection) {
        if (connection != null) {
            lb.markServerDown(connection.getServer());
            removeConnection(new ImmutableSet.Builder<Server>().add(connection.getServer()).build());
        }
    }
669842
public void purgeClosedConnection(OutboundConnection connection)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "purgeClosedConnection", connection);
        connection.getConnectionData().getConnectionDataGroup().purgeClosedConnection(connection);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "purgeClosedConnection");
    }
174827
private void cleanConnectionClose(Connection connection, Statement stmt) {
        try {
            // clean close
            if (connection != null) {
                connection.rollback();
            }

            if (stmt != null) {
                stmt.close();
            }

            if (connection != null) {
                connection.close();
            }
        } catch (SQLException e1) {
            e1.printStackTrace();
        }
    }