Package com.sun.corba.se.impl.transport
Class CorbaConnectionCacheBase
java.lang.Object
com.sun.corba.se.impl.transport.CorbaConnectionCacheBase
- All Implemented Interfaces:
ConnectionCache,CorbaConnectionCache
- Direct Known Subclasses:
CorbaInboundConnectionCacheImpl,CorbaInboundConnectionCacheImpl,CorbaOutboundConnectionCacheImpl
public abstract class CorbaConnectionCacheBase
extends Object
implements ConnectionCache, CorbaConnectionCache
- Author:
- Harold Carr
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected ORBprotected longprotected ORBUtilSystemException -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCorbaConnectionCacheBase(ORB orb, String cacheType, String monitoringName) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Objectvoidclose()Close all connections in the connection cache.protected voidprotected voidprotected voidlonglonglongbooleanreclaim()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 <= .... ).protected abstract voidvoidabstract Collectionvalues()
-
Field Details
-
orb
-
timestamp
protected long timestamp -
cacheType
-
monitoringName
-
wrapper
-
-
Constructor Details
-
CorbaConnectionCacheBase
-
-
Method Details
-
getCacheType
- Specified by:
getCacheTypein interfaceConnectionCache
-
stampTime
- Specified by:
stampTimein interfaceConnectionCache
-
numberOfConnections
public long numberOfConnections()- Specified by:
numberOfConnectionsin interfaceConnectionCache
-
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
-
numberOfIdleConnections
public long numberOfIdleConnections()- Specified by:
numberOfIdleConnectionsin interfaceConnectionCache
-
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 & 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 interfaceCorbaConnectionCache
-
values
-
backingStore
-
registerWithMonitoring
protected abstract void registerWithMonitoring() -
dprintCreation
protected void dprintCreation() -
dprintStatistics
protected void dprintStatistics() -
dprint
-