Interface IGlobalPoolStrategy

  • All Known Implementing Classes:
    ConstantGlobalPoolStrategy

    public interface IGlobalPoolStrategy
    Interface for a global pool strategy. Allows for: - worker management - proxy configuration
    • Method Detail

      • workersAdded

        void workersAdded​(IComponentIdentifier... workers)
        Called when workers have been created.
        Parameters:
        workers - The workers.
      • workersRemoved

        void workersRemoved​(IComponentIdentifier... workers)
        Called when workers have been removed.
        Parameters:
        workers - The workers.
      • workerTimeoutOccurred

        boolean workerTimeoutOccurred​(IComponentIdentifier worker)
        Notify the strategy that a timeout for a worker component has occurred, i.e. it was not needed for serving some worker.
        Returns:
        True, if the component be excluded from the pool.
      • getWorkerTimeout

        long getWorkerTimeout()
        Get the component timeout.
        Returns:
        The timeout for the component to wait for new workers in the pool.
      • getWorkerCount

        int getWorkerCount()
        Get the worker cnt.
      • getDesiredWorkerCount

        int getDesiredWorkerCount()
        Get the desired worker cnt.
      • isCreateWorkerOn

        boolean isCreateWorkerOn​(IComponentIdentifier cid)
        Ask strategy if a new worker should be added on a platform.
        Parameters:
        cid - The platform.
        Returns:
        True, if worker should be created.
      • getWorkersPerProxy

        int getWorkersPerProxy()
        Get the number of workers that should be used by each proxy.
        Returns:
        The number of workers used by each proxy.