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
public abstract class ConnectionCacheBase extends java.lang.Object implements ConnectionCache
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringBUSY_DESCprivate static java.lang.StringBUSY_IDprivate static java.lang.StringBUSY_ID_STDprotected java.lang.StringcacheTypeprivate static java.lang.StringIDLE_DESCprivate static java.lang.StringIDLE_IDprivate static java.lang.StringIDLE_ID_STDprotected java.lang.StringmonitoringNameprotected ORBorbprivate static java.lang.StringSTAT_UNITprotected longtimestampprivate static java.lang.StringTOTAL_DESCprivate static java.lang.StringTOTAL_IDprivate static java.lang.StringTOTAL_ID_STDprotected static ORBUtilSystemExceptionwrapper
-
Constructor Summary
Constructors Modifier Constructor Description protectedConnectionCacheBase(ORB orb, java.lang.String cacheType, java.lang.String monitoringName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.ObjectbackingStore()protected voidcacheStatisticsInfo()private 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(java.lang.String cacheType, java.lang.String monitoringName)protected voiddprintCreation()java.lang.StringgetCacheType()java.lang.StringgetMonitoringName()private org.glassfish.external.statistics.CountStatisticmakeCountStat(java.lang.String name, java.lang.String desc, long value)longnumberOfBusyConnections()private org.glassfish.external.statistics.CountStatisticnumberOfBusyConnectionsAttr()longnumberOfConnections()private org.glassfish.external.statistics.CountStatisticnumberOfConnectionsAttr()longnumberOfIdleConnections()private org.glassfish.external.statistics.CountStatisticnumberOfIdleConnectionsAttr()booleanreclaim()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)voidstampTime(Connection c)abstract java.util.Collectionvalues()
-
-
-
Field Detail
-
wrapper
protected static final ORBUtilSystemException wrapper
-
STAT_UNIT
private static final java.lang.String STAT_UNIT
- See Also:
- Constant Field Values
-
TOTAL_ID_STD
private static final java.lang.String TOTAL_ID_STD
- See Also:
- Constant Field Values
-
TOTAL_ID
private static final java.lang.String TOTAL_ID
- See Also:
- Constant Field Values
-
IDLE_ID_STD
private static final java.lang.String IDLE_ID_STD
- See Also:
- Constant Field Values
-
IDLE_ID
private static final java.lang.String IDLE_ID
- See Also:
- Constant Field Values
-
BUSY_ID_STD
private static final java.lang.String BUSY_ID_STD
- See Also:
- Constant Field Values
-
BUSY_ID
private static final java.lang.String BUSY_ID
- See Also:
- Constant Field Values
-
TOTAL_DESC
private static final java.lang.String TOTAL_DESC
- See Also:
- Constant Field Values
-
IDLE_DESC
private static final java.lang.String IDLE_DESC
- See Also:
- Constant Field Values
-
BUSY_DESC
private static final java.lang.String BUSY_DESC
- See Also:
- Constant Field Values
-
orb
protected ORB orb
-
timestamp
protected long timestamp
-
cacheType
protected java.lang.String cacheType
-
monitoringName
protected java.lang.String monitoringName
-
-
Constructor Detail
-
ConnectionCacheBase
protected ConnectionCacheBase(ORB orb, java.lang.String cacheType, java.lang.String monitoringName)
-
-
Method Detail
-
getCacheType
@NameValue public java.lang.String getCacheType()
- Specified by:
getCacheTypein interfaceConnectionCache
-
stampTime
public void stampTime(Connection c)
- Specified by:
stampTimein interfaceConnectionCache
-
makeCountStat
private org.glassfish.external.statistics.CountStatistic makeCountStat(java.lang.String name, java.lang.String desc, long value)
-
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
public java.lang.String getMonitoringName()
- Specified by:
getMonitoringNamein interfaceConnectionCache
-
values
public abstract java.util.Collection values()
-
backingStore
protected abstract java.lang.Object backingStore()
-
creationInfo
@InfoMethod private void creationInfo(java.lang.String cacheType, java.lang.String monitoringName)
-
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
@InfoMethod private void closingInfo(Connection toClose)
-
connectionsReclaimedInfo
@InfoMethod private void connectionsReclaimedInfo(long l)
-
-