Interface ModelFarm

All Known Implementing Classes:
ModelFarmBase, ModelFarmOnDemand, ModelFarmRealTime, ModelFarmTick, RDMModelFarm

public interface ModelFarm
A multithreaded resource to execute data driven models.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Blocks until all tasks have completed execution after a shutdown request.
    boolean
    awaitTermination(long timeout, TimeUnit unit)
    Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, whichever happens first.
    void
    Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
    void
    Shuts down and then awaits termination.
    boolean
    Shuts down and then awaits termination.
    void
    Initiates execution.
    void
    Initiates an immediate termination of all tasks.
  • Method Details

    • start

      void start()
      Initiates execution.
    • shutdown

      void shutdown()
      Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down.

      This method does not wait for previously submitted tasks to complete execution. Use awaitTermination to do that.

    • terminate

      void terminate()
      Initiates an immediate termination of all tasks. Unexecuted tasks will not be executed. Tasks already executing may not be interrupted.
    • awaitTermination

      boolean awaitTermination()
      Blocks until all tasks have completed execution after a shutdown request.
      Returns:
      true if this executor terminated and false if the timeout elapsed before termination
    • awaitTermination

      boolean awaitTermination(long timeout, TimeUnit unit)
      Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, whichever happens first.
      Parameters:
      timeout - the maximum time to wait
      unit - the time unit of the timeout argument
      Returns:
      true if this executor terminated and false if the timeout elapsed before termination
    • shutdownAndAwaitTermination

      void shutdownAndAwaitTermination()
      Shuts down and then awaits termination.
    • shutdownAndAwaitTermination

      boolean shutdownAndAwaitTermination(long timeout, TimeUnit unit)
      Shuts down and then awaits termination.
      Parameters:
      timeout - the maximum time to wait
      unit - the time unit of the timeout argument
      Returns:
      true if this executor terminated and false if the timeout elapsed before termination