Class DefaultTimeoutService

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <V> V execute​(java.util.concurrent.Callable<V> callable, long timeout)
      Executes the Callable and wait until the timeout period expires.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultTimeoutService

        public DefaultTimeoutService()
    • Method Detail

      • execute

        public <V> V execute​(java.util.concurrent.Callable<V> callable,
                             long timeout)
        Executes the Callable and wait until the timeout period expires. When the timeout occurred the implementation may decide to return a value indicating so, or an exception is thrown. A timeout value less than 1 ms will timeout immediately, and an IntegrationTimeoutException will be thrown.
        Specified by:
        execute in interface TimeoutService
        Type Parameters:
        V - The type of the return value from the Callable
        Parameters:
        callable - The logic to execute
        timeout - The period to wait for the execution to complete. Negative value should result in an IntegrationTimeoutException. The implementation can decide what to do with 0. It can throw an IntegrationTimeoutException, or equate 0 to wait indefinitely.
        Returns:
        The value returned from the Callable