Package jadex.commons

Interface IPoolStrategy

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getCapacity()
      Get the number of free workers.
      int getWorkerCount()
      Get the worker cnt.
      long getWorkerTimeout()
      Get the component timeout.
      boolean taskAdded()
      Called when a new task was added to the pool.
      boolean taskFinished()
      Called when a task is finished.
      void taskServed​(long waitdur)
      Called when a new task was served from the pool.
      void workersAdded​(int cnt)
      Called when a new worker was added proactively to the pool.
      boolean workerTimeoutOccurred()
      Notify the strategy that a timeout for a worker component has occurred, i.e. it was not needed for serving some worker.
    • Method Detail

      • taskAdded

        boolean taskAdded()
        Called when a new task was added to the pool.
        Returns:
        True, if a new worker should be added to the pool.
      • taskServed

        void taskServed​(long waitdur)
        Called when a new task was served from the pool.
        Parameters:
        waitdur - The waiting time of the task.
      • taskFinished

        boolean taskFinished()
        Called when a task is finished.
        Returns:
        True, if executing worker should be removed from the pool.
      • workersAdded

        void workersAdded​(int cnt)
        Called when a new worker was added proactively to the pool. Workers are automatically removed by the strategy as result of taskFinished().
        Parameters:
        cnt - The number of new workers.
      • getWorkerTimeout

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

        boolean workerTimeoutOccurred()
        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.
      • getWorkerCount

        int getWorkerCount()
        Get the worker cnt.
      • getCapacity

        int getCapacity()
        Get the number of free workers.