com.sun.grizzly.connectioncache.impl.transport
Class ConnectionCacheBase<C extends Closeable>

java.lang.Object
  extended by com.sun.grizzly.connectioncache.impl.transport.ConnectionCacheBase<C>
All Implemented Interfaces:
ConnectionCache<C>
Direct Known Subclasses:
InboundConnectionCacheBlockingImpl, OutboundConnectionCacheBlockingImpl

public abstract class ConnectionCacheBase<C extends Closeable>
extends Object
implements ConnectionCache<C>


Field Summary
protected  Logger logger
           
protected  ConcurrentQueue<C> reclaimableConnections
           
 
Method Summary
protected  boolean debug()
           
protected  void dprint(String msg)
           
 void dprintStatistics()
           
 String getCacheType()
          User-provided indentifier for an instance of the ConnectionCache.
 int highWaterMark()
          Threshold at which connection reclamation begins.
 int numberToReclaim()
          Number of connections to reclaim each time reclamation starts.
protected  boolean reclaim()
          Reclaim some idle cached connections.
protected abstract  String thisClassName()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.grizzly.connectioncache.spi.transport.ConnectionCache
close, numberOfBusyConnections, numberOfConnections, numberOfIdleConnections, numberOfReclaimableConnections
 

Field Detail

logger

protected final Logger logger

reclaimableConnections

protected ConcurrentQueue<C extends Closeable> reclaimableConnections
Method Detail

debug

protected boolean debug()

getCacheType

public final String getCacheType()
Description copied from interface: ConnectionCache
User-provided indentifier for an instance of the ConnectionCache.

Specified by:
getCacheType in interface ConnectionCache<C extends Closeable>
Returns:
a String identifying an instance of a ConnectionCache

numberToReclaim

public final int numberToReclaim()
Description copied from interface: ConnectionCache
Number of connections to reclaim each time reclamation starts.

Specified by:
numberToReclaim in interface ConnectionCache<C extends Closeable>
Returns:
number of connections to reclaim

highWaterMark

public final int highWaterMark()
Description copied from interface: ConnectionCache
Threshold at which connection reclamation begins.

Specified by:
highWaterMark in interface ConnectionCache<C extends Closeable>
Returns:
threshold at which connection reclamation begins.

thisClassName

protected abstract String thisClassName()

dprint

protected final void dprint(String msg)

toString

public String toString()
Overrides:
toString in class Object

dprintStatistics

public void dprintStatistics()

reclaim

protected boolean reclaim()
Reclaim some idle cached connections. Will never close a connection that is busy.

Returns:
any connections reclaimed, (yes or no)


Copyright © 2012 Oracle Corporation. All Rights Reserved.