Class SynchlingPool

  • All Implemented Interfaces:
    org.bedework.util.logging.Logged

    public class SynchlingPool
    extends Object
    implements org.bedework.util.logging.Logged
    manage a pool of synchlings.
    Author:
    Mike Douglass
    • Constructor Detail

      • SynchlingPool

        public SynchlingPool()
    • Method Detail

      • start

        public void start​(SynchEngine syncher,
                          int size,
                          long timeout)
        Create a pool with the given size
        Parameters:
        syncher -
        size -
        timeout - - millisecs
      • stop

        public void stop()
        Shut down active synchlings
      • resize

        public void resize​(int size)
        Resize the pool
        Parameters:
        size -
      • setTimeout

        public void setTimeout​(long val)
        Parameters:
        val - timeout in millisecs
      • getTimeout

        public long getTimeout()
        Returns:
        timeout in millisecs
      • getActiveCt

        public long getActiveCt()
        Returns:
        number active
      • getWaitTimes

        public long getWaitTimes()
        Returns:
        total waitTimes in millisecs
      • getGets

        public long getGets()
        Returns:
        number of gets
      • getGetSynchlingFailures

        public long getGetSynchlingFailures()
        Returns:
        number of get failures
      • getCurrentMaxSize

        public int getCurrentMaxSize()
        Returns:
        current size of pool
      • getCurrentAvailable

        public int getCurrentAvailable()
        Return approximate number of available synchlings
        Returns:
        current avail
      • getNoException

        public Synchling getNoException()
                                 throws SynchException
        Get a synchling from the pool if possible. Return null if timed out
        Returns:
        a sychling or null
        Throws:
        SynchException - on error
      • getStats

        public List<Stat> getStats()
        Get the current stats
        Returns:
        List of Stat
      • getLogger

        public org.bedework.util.logging.BwLogger getLogger()
        Specified by:
        getLogger in interface org.bedework.util.logging.Logged