Class TimeoutGuard

java.lang.Object
org.frankframework.task.TimeoutGuard

public class TimeoutGuard extends Object
TimeoutGuard interrupts running thread when timeout is exceeded.
Since:
4.9.10
Author:
Gerrit van Brakel
  • Field Details

    • log

      protected org.apache.logging.log4j.Logger log
  • Constructor Details

    • TimeoutGuard

      public TimeoutGuard(String description)
      Create a new TimeoutGuard
      Parameters:
      description - name of the guard
    • TimeoutGuard

      public TimeoutGuard(int timeout, String description)
      Create a new TimeoutGuard and activate immediately
      Parameters:
      timeout - in seconds
      description - name of the guard
  • Method Details

    • activateGuard

      public void activateGuard(int timeout)
      Sets and activates the timeout
      Parameters:
      timeout - in seconds
    • cancel

      public boolean cancel()
      Cancels timer, and returns true if thread has been killed by this guard or interrupted by another.

      Call this in a finally-block to verify correct execution of the guarded process or if it has been interrupted by the guard.
    • abort

      protected void abort()
      Implement this method to stop the process and cleanup the resources you are 'guarding'.
    • threadKilled

      public boolean threadKilled()
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)