Interface ThreadPoolSizingStrategy


  • public interface ThreadPoolSizingStrategy
    A ThreadPoolSizingStrategy is a pluggable strategy used by a Coherence service thread pool to manage its size.

    The ThreadPoolSizingStrategy is initialized during the starting of a Service. The strategy will periodically analyze the threads usage of the thread pool and make adjustments to the size of its thread pool. Strategies may be stateful (e.g. some strategies may formulate recommendations based on trends over accumulated statistics).

    Since:
    Coherence 12.1.2
    Author:
    lh 2011.12.21
    • Method Detail

      • init

        void init​(ThreadPoolManager mgr)
        Initialize the ThreadPoolSizingStrategy and bind it to the specified manager.
        Parameters:
        mgr - the ThreadPoolManager this strategy will be bound to
      • adjustPoolSize

        int adjustPoolSize()
        Analyze the thread usage of the thread pool. If adjustment of the thread pool size is needed, return the target pool size; otherwise, -1 when no adjustment is necessary. The strategy can influence the frequency with which it is analyzed by specifying the desired time interval for the next adjustment. The caller of the strategy is responsible setting the target size of its thread pool.

        The mutation of the statistics information exposed by the Coherence thread pool for the duration of this method call should have minimum impact on the target thread pool size.

        Returns:
        the target thread pool size of the thread pool or -1 if no adjustment is necessary
      • getDescription

        String getDescription()
        Return a human-readable description of the state of the ThreadPoolSizingStrategy.
        Returns:
        a human-readable description