## com.sun.grizzly.connectioncache.spi.transport
Interface ConnectionCache<C extends Closeable>

All Known Subinterfaces:
  InboundConnectionCache<C>, OutboundConnectionCache<C>

All Known Implementing Classes:
  ConnectionCacheBase, InboundConnectionCacheBlockingImpl, OutboundConnectionCacheBlockingImpl

    public interface ConnectionCache<C extends Closeable>

A connection cache manages a group of connections which may be re-used for sending and receiving messages.

Method Summary
`void` `close(C conn)` Close a connection, regardless of its state.
`String` `getCacheType()` User-provided indentifier for an instance of the `ConnectionCache`.
`int` `highWaterMark()` Threshold at which connection reclamation begins.
`long` `numberOfBusyConnections()` Number of non-idle connections.
`long` `numberOfConnections()` Total number of connections currently managed by the cache.
`long` `numberOfIdleConnections()` Number of idle connections; that is, connections for which the number of get/release or responseReceived/responseProcessed calls are equal.
`long` `numberOfReclaimableConnections()` Number of idle connections that are reclaimable.
`int` `numberToReclaim()` Number of connections to reclaim each time reclamation starts.

Method Detail

### getCacheType

    String getCacheType()

  User-provided indentifier for an instance of the `ConnectionCache`.

  Returns:
    a `String` identifying an instance of a `ConnectionCache`

### numberOfConnections

    long numberOfConnections()

  Total number of connections currently managed by the cache.

  Returns:
    number of connections currently managed by the cache

### numberOfIdleConnections

    long numberOfIdleConnections()

  Number of idle connections; that is, connections for which the number of get/release or responseReceived/responseProcessed calls are equal.

  Returns:
    number of idle connections

### numberOfBusyConnections

    long numberOfBusyConnections()

  Number of non-idle connections. Normally, busy+idle==total, but this may not be strictly true due to concurrent updates to the connection cache.

  Returns:
    number of busy connections

### numberOfReclaimableConnections

    long numberOfReclaimableConnections()

  Number of idle connections that are reclaimable. Such connections are not in use, and are not waiting to handle any responses.

  Returns:
    number of idle connections that are reclaimable

### highWaterMark

    int highWaterMark()

  Threshold at which connection reclamation begins.

  Returns:
    threshold at which connection reclamation begins.

### numberToReclaim

    int numberToReclaim()

  Number of connections to reclaim each time reclamation starts.

  Returns:
    number of connections to reclaim

### close

    void close(C conn)

  Close a connection, regardless of its state. This may cause requests to fail to be sent, and responses to be lost. Intended for handling serious errors, such as loss of framing on a TCP stream, that require closing the connection.

  Parameters:
    `conn` - a connection

Copyright © 2008 SUN Microsystems. All Rights Reserved.