Class ConnectionCacheBase

java.lang.Object
com.sun.corba.ee.impl.transport.ConnectionCacheBase
All Implemented Interfaces:
ConnectionCache
Direct Known Subclasses:
InboundConnectionCacheImpl, OutboundConnectionCacheImpl

public abstract class ConnectionCacheBase extends Object implements ConnectionCache
Author:
Harold Carr
  • Field Details

    • wrapper

      protected static final ORBUtilSystemException wrapper
    • orb

      protected ORB orb
    • timestamp

      protected long timestamp
    • cacheType

      protected String cacheType
    • monitoringName

      protected String monitoringName
  • Constructor Details

    • ConnectionCacheBase

      protected ConnectionCacheBase(ORB orb, String cacheType, String monitoringName)
  • Method Details

    • getCacheType

      @NameValue public String getCacheType()
      Specified by:
      getCacheType in interface ConnectionCache
    • stampTime

      public void stampTime(Connection c)
      Specified by:
      stampTime in interface ConnectionCache
    • 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 interface ConnectionCache
    • numberOfConnections

      public long numberOfConnections()
      Specified by:
      numberOfConnections in interface ConnectionCache
    • numberOfIdleConnections

      public long numberOfIdleConnections()
      Specified by:
      numberOfIdleConnections in interface ConnectionCache
    • numberOfBusyConnections

      public long numberOfBusyConnections()
      Specified by:
      numberOfBusyConnections in interface ConnectionCache
    • 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 interface ConnectionCache
    • getMonitoringName

      public String getMonitoringName()
      Specified by:
      getMonitoringName in interface ConnectionCache
    • values

      public abstract Collection values()
      /////////////////////////////////////////////////
    • backingStore

      protected abstract Object backingStore()
    • dprintCreation

      protected void dprintCreation()
    • cacheStatisticsInfo

      protected void cacheStatisticsInfo()