Class ConnectionCacheBase<C extends Connection>
- java.lang.Object
-
- com.sun.corba.ee.impl.transport.connection.ConnectionCacheBase<C>
-
- All Implemented Interfaces:
ConnectionCache<C>
- Direct Known Subclasses:
ConnectionCacheBlockingBase,ConnectionCacheNonBlockingBase
public abstract class ConnectionCacheBase<C extends Connection> extends java.lang.Object implements ConnectionCache<C>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcacheTypeprivate booleanflagprivate inthighWaterMarkprivate intnumberToReclaimprotected ConcurrentQueue<C>reclaimableConnections
-
Constructor Summary
Constructors Constructor Description ConnectionCacheBase(java.lang.String cacheType, int highWaterMark, int numberToReclaim)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private voiddisplay(java.lang.String msg, java.lang.Object value)java.lang.StringgetCacheType()User-provided identifier for an instance of the OutboundConnectionCache.inthighWaterMark()Threshold at which connection reclamation begins.intnumberToReclaim()Number of connections to reclaim each time reclamation starts.protected booleanreclaim()Reclaim some idle cached connections.protected abstract java.lang.StringthisClassName()java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.sun.corba.ee.spi.transport.connection.ConnectionCache
close, numberOfBusyConnections, numberOfConnections, numberOfIdleConnections, numberOfReclaimableConnections
-
-
-
-
Field Detail
-
flag
private boolean flag
-
cacheType
private final java.lang.String cacheType
-
highWaterMark
private final int highWaterMark
-
numberToReclaim
private final int numberToReclaim
-
reclaimableConnections
protected ConcurrentQueue<C extends Connection> reclaimableConnections
-
-
Method Detail
-
getCacheType
public final java.lang.String getCacheType()
Description copied from interface:ConnectionCacheUser-provided identifier for an instance of the OutboundConnectionCache.- Specified by:
getCacheTypein interfaceConnectionCache<C extends Connection>- Returns:
- identifier String
-
numberToReclaim
public final int numberToReclaim()
Description copied from interface:ConnectionCacheNumber of connections to reclaim each time reclamation starts.- Specified by:
numberToReclaimin interfaceConnectionCache<C extends Connection>- Returns:
- number to reclaim
-
highWaterMark
public final int highWaterMark()
Description copied from interface:ConnectionCacheThreshold at which connection reclamation begins.- Specified by:
highWaterMarkin interfaceConnectionCache<C extends Connection>- Returns:
- threshold
-
thisClassName
protected abstract java.lang.String thisClassName()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
display
@InfoMethod private void display(java.lang.String msg, java.lang.Object value)
-
reclaim
protected boolean reclaim()
Reclaim some idle cached connections. Will never close a connection that is busy.- Returns:
- True if at least one connection was reclaimed
-
-