Class MaxTimeTerminationStrategy

  • All Implemented Interfaces:
    TerminationStrategy

    public class MaxTimeTerminationStrategy
    extends Object
    implements TerminationStrategy
    Termination strategy that allows up to X milliseconds to have elapsed before terminating.
    • Constructor Detail

      • MaxTimeTerminationStrategy

        @ConstructorProperties("maxTimeInMillis")
        public MaxTimeTerminationStrategy​(long maxTimeInMillis)
    • Method Detail

      • ofTimeUnit

        public static MaxTimeTerminationStrategy ofTimeUnit​(long maxTime,
                                                            TimeUnit timeUnit)
        Create a new termination strategy that allows up to the specified number of time units to have elapsed before terminating.
        Parameters:
        maxTime - number of time units
        timeUnit - time unit
        Returns:
        termination strategy
      • ofMillis

        public static MaxTimeTerminationStrategy ofMillis​(long maxTimeInMillis)
        Create a new termination strategy that allows up to the specified number of milliseconds to have elapsed before terminating.
        Parameters:
        maxTimeInMillis - number of milliseconds
        Returns:
        termination strategy
      • ofSeconds

        public static MaxTimeTerminationStrategy ofSeconds​(long maxTimeInSeconds)
        Create a new termination strategy that allows up to the specified number of seconds to have elapsed before terminating.
        Parameters:
        maxTimeInSeconds - number of seconds
        Returns:
        termination strategy
      • ofMinutes

        public static MaxTimeTerminationStrategy ofMinutes​(long maxTimeInMinutes)
        Create a new termination strategy that allows up to the specified number of minutes to have elapsed before terminating.
        Parameters:
        maxTimeInMinutes - number of minutes
        Returns:
        termination strategy