Interface FakeLoadScheduler

All Known Implementing Classes:
DefaultFakeLoadScheduler

public interface FakeLoadScheduler
Object that schedules submitted FakeLoad objects. This interface provides a way of decoupling a FakeLoad's submission for execution from the mechanics of how a FakeLoad's load instructions are actually scheduled for execution.

This interface is provided as kind of utility type for the DefaultFakeLoadExecutor to take over the responsibility of actually scheduling FakeLoads in a correct manner.

As the method provided by the FakeLoadScheduler schedule(FakeLoad) returns a Future, implementations of the FakeLoadExecutor should just call Future.get() on the returned future. This would block the execute() method of the FakeLoadExecutor as required by its contract.

Class DefaultFakeLoadScheduler provides a default implementation of this interface that uses the FakeLoad.iterator() method as its scheduling mechanism.

Since:
1.8
See Also:
FakeLoad, DefaultFakeLoadScheduler, DefaultFakeLoadExecutor
  • Method Summary

    Modifier and Type Method Description
    java.util.concurrent.Future<java.lang.Void> schedule​(FakeLoad fakeLoad)
    Schedules a FakeLoad's load instructions for execution at the right time.
  • Method Details

    • schedule

      java.util.concurrent.Future<java.lang.Void> schedule​(FakeLoad fakeLoad)
      Schedules a FakeLoad's load instructions for execution at the right time.
      Parameters:
      fakeLoad - the FakeLoad object to be scheduled.
      Returns:
      a Future indicating whether the scheduled loads have executed successfully or have thrown an error.