Interface Stoppable


public interface Stoppable
Provides a mechanism to stop the processing before completion. When an operation is stopped it will either exit normally or throw the runtime exception Stoppable.Stopped. In either case the function isStopRequested() will return true. A class which has been stopped early can often be called be called again, but the stop request flag is typically reset internally and a few milliseconds should be provided for the process to launch and be reset. The only way to tell if a process has stopped is to observe that the next operation after it has been called.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Exception which is thrown when a process has been stopped early.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    True if a request to stop has been sent.
    void
    Invoke to request that the process stop running.
  • Method Details

    • requestStop

      void requestStop()
      Invoke to request that the process stop running. The process will not immediately stop and an undefined amount of time will pass before it has stopped.
    • isStopRequested

      boolean isStopRequested()
      True if a request to stop has been sent. If a stopped process is invoked again this flag might not be immediately reset. This bit of amiguity is done to greatly simplify implementation of this interface.
      Returns:
      true if a stop request has been sent