Class ConnectionCacheBase

    • Constructor Detail

      • ConnectionCacheBase

        protected ConnectionCacheBase​(ORB orb,
                                      java.lang.String cacheType,
                                      java.lang.String monitoringName)
    • Method Detail

      • 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: 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
      • numberOfConnectionsAttr

        @ManagedAttribute(id="totalconnections")
        @Description("Total number of connections in the connection cache")
        private org.glassfish.external.statistics.CountStatistic numberOfConnectionsAttr()
      • numberOfIdleConnectionsAttr

        @ManagedAttribute(id="connectionsidle")
        @Description("Number of connections in the connection cache that are idle")
        private org.glassfish.external.statistics.CountStatistic numberOfIdleConnectionsAttr()
      • numberOfBusyConnectionsAttr

        @ManagedAttribute(id="connectionsbusy")
        @Description("Number of connections in the connection cache that are in use")
        private org.glassfish.external.statistics.CountStatistic numberOfBusyConnectionsAttr()
      • 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
      • 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)