Class ConnectionCacheBase
java.lang.Object
com.sun.corba.ee.impl.transport.ConnectionCacheBase
- All Implemented Interfaces:
ConnectionCache
- Direct Known Subclasses:
InboundConnectionCacheImpl, NoConnectionCacheImpl.NCCConnectionCacheImpl, OutboundConnectionCacheImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprotected Stringprivate static final Stringprivate static final Stringprivate static final Stringprotected Stringprotected ORBprivate static final Stringprotected longprivate static final Stringprivate static final Stringprivate static final Stringprotected static final ORBUtilSystemException -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConnectionCacheBase(ORB orb, String cacheType, String monitoringName) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Objectprotected voidprivate voidcacheStatsInfo(long numberOfConnections, long numberOfBusyConnections, long numberOfIdleConnections, int highWaterMark, int numberToReclaim) voidclose()Close all connections in the connection cache.private voidclosingInfo(Connection toClose) private voidconnectionsReclaimedInfo(long l) private voidcreationInfo(String cacheType, String monitoringName) protected voidprivate org.glassfish.external.statistics.CountStatisticmakeCountStat(String name, String desc, long value) longprivate org.glassfish.external.statistics.CountStatisticlongprivate org.glassfish.external.statistics.CountStatisticlongprivate org.glassfish.external.statistics.CountStatisticbooleanreclaim()Discarding least recently used Connections that are not busy This method must be synchronized since one WorkerThread could be reclaming connections inside the synchronized backingStore block and a second WorkerThread (or a SelectorThread) could have already executed the if (numberOfConnections <= ....private voidreclaimInfo(long numberOfConnections, int highWaterMark, int numberToReclaim) voidabstract Collectionvalues()/////////////////////////////////////////////////
-
Field Details
-
wrapper
-
STAT_UNIT
- See Also:
-
TOTAL_ID_STD
- See Also:
-
TOTAL_ID
- See Also:
-
IDLE_ID_STD
- See Also:
-
IDLE_ID
- See Also:
-
BUSY_ID_STD
- See Also:
-
BUSY_ID
- See Also:
-
TOTAL_DESC
- See Also:
-
IDLE_DESC
- See Also:
-
BUSY_DESC
- See Also:
-
orb
-
timestamp
protected long timestamp -
cacheType
-
monitoringName
-
-
Constructor Details
-
ConnectionCacheBase
-
-
Method Details
-
getCacheType
- Specified by:
getCacheTypein interfaceConnectionCache
-
stampTime
- Specified by:
stampTimein interfaceConnectionCache
-
makeCountStat
-
close
public void close()Description copied from interface:ConnectionCacheClose all connections in the connection cache. This is used as a final cleanup, and will result in abrupt termination of any pending communications.- Specified by:
closein interfaceConnectionCache
-
numberOfConnectionsAttr
@ManagedAttribute(id="totalconnections") @Description("Total number of connections in the connection cache") private org.glassfish.external.statistics.CountStatistic numberOfConnectionsAttr() -
numberOfConnections
public long numberOfConnections()- Specified by:
numberOfConnectionsin interfaceConnectionCache
-
numberOfIdleConnectionsAttr
@ManagedAttribute(id="connectionsidle") @Description("Number of connections in the connection cache that are idle") private org.glassfish.external.statistics.CountStatistic numberOfIdleConnectionsAttr() -
numberOfIdleConnections
public long numberOfIdleConnections()- Specified by:
numberOfIdleConnectionsin interfaceConnectionCache
-
numberOfBusyConnectionsAttr
@ManagedAttribute(id="connectionsbusy") @Description("Number of connections in the connection cache that are in use") private org.glassfish.external.statistics.CountStatistic numberOfBusyConnectionsAttr() -
numberOfBusyConnections
public long numberOfBusyConnections()- Specified by:
numberOfBusyConnectionsin interfaceConnectionCache
-
reclaim
public boolean reclaim()Discarding least recently used Connections that are not busy This method must be synchronized since one WorkerThread could be reclaming connections inside the synchronized backingStore block and a second WorkerThread (or a SelectorThread) could have already executed the if (numberOfConnections <= .... ). As a result the second thread would also attempt to reclaim connections. If connection reclamation becomes a performance issue, the connection reclamation could make its own task and consequently executed in a separate thread. Currently, the accept and reclaim are done in the same thread, WorkerThread by default. It could be changed such that the SelectorThread would do it for SocketChannels and WorkerThreads for Sockets by updating the ParserTable.- Specified by:
reclaimin interfaceConnectionCache
-
getMonitoringName
- Specified by:
getMonitoringNamein interfaceConnectionCache
-
values
///////////////////////////////////////////////// -
backingStore
-
creationInfo
-
dprintCreation
protected void dprintCreation() -
cacheStatsInfo
@InfoMethod private void cacheStatsInfo(long numberOfConnections, long numberOfBusyConnections, long numberOfIdleConnections, int highWaterMark, int numberToReclaim) -
cacheStatisticsInfo
protected void cacheStatisticsInfo() -
reclaimInfo
@InfoMethod private void reclaimInfo(long numberOfConnections, int highWaterMark, int numberToReclaim) -
closingInfo
-
connectionsReclaimedInfo
@InfoMethod private void connectionsReclaimedInfo(long l)
-