Package com.sun.corba.ee.impl.transport
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 String
private static final String
private static final String
protected String
private static final String
private static final String
private static final String
protected String
protected ORB
private static final String
protected long
private static final String
private static final String
private static final String
protected static final ORBUtilSystemException
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ConnectionCacheBase
(ORB orb, String cacheType, String monitoringName) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Object
protected void
private void
cacheStatsInfo
(long numberOfConnections, long numberOfBusyConnections, long numberOfIdleConnections, int highWaterMark, int numberToReclaim) void
close()
Close all connections in the connection cache.private void
closingInfo
(Connection toClose) private void
connectionsReclaimedInfo
(long l) private void
creationInfo
(String cacheType, String monitoringName) protected void
private org.glassfish.external.statistics.CountStatistic
makeCountStat
(String name, String desc, long value) long
private org.glassfish.external.statistics.CountStatistic
long
private org.glassfish.external.statistics.CountStatistic
long
private org.glassfish.external.statistics.CountStatistic
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 <= ....private void
reclaimInfo
(long numberOfConnections, int highWaterMark, int numberToReclaim) void
abstract Collection
values()
-
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:
getCacheType
in interfaceConnectionCache
-
stampTime
- Specified by:
stampTime
in interfaceConnectionCache
-
makeCountStat
-
close
public void close()Description copied from interface:ConnectionCache
Close 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:
close
in 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:
numberOfConnections
in 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:
numberOfIdleConnections
in 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:
numberOfBusyConnections
in 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:
reclaim
in interfaceConnectionCache
-
getMonitoringName
- Specified by:
getMonitoringName
in 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)
-