java.lang.Object
ee.jakarta.tck.concurrent.spec.ManagedScheduledExecutorService.resourcedef.ReqBean

@RequestScoped public class ReqBean extends Object
  • Constructor Details

    • ReqBean

      public ReqBean()
  • Method Details

    • awaitAndGetThirdPartyContext

      @Asynchronous(executor="java:app/concurrent/ScheduledExecutorA") public CompletableFuture<String> awaitAndGetThirdPartyContext(Semaphore invocationsStarted, CountDownLatch blocker)
    • lookUpAContextService

      @Asynchronous(executor="java:comp/concurrent/ScheduledExecutorC") public CompletionStage<ContextService> lookUpAContextService()
    • notAsynchronous

      public CompletableFuture<String> notAsynchronous()
    • scheduledEvery5seconds

      @Asynchronous(executor="java:comp/DefaultManagedScheduledExecutorService", runAt=@Schedule(cron="*/5 * * * * *")) public CompletableFuture<Integer> scheduledEvery5seconds(int runs, ReqBean.RETURN type, AtomicInteger counter)
      A scheduled async method that runs every 5 seconds
      Parameters:
      runs - - how many times to run before returning
      type - - how this method should return (successfully / incomplete / exceptionally)
      counter - - The counter provided from the caller to compare against
      Returns:
      A result or exception
    • scheduledEvery3SecondsVoidReturn

      @Asynchronous(executor="java:comp/DefaultManagedScheduledExecutorService", runAt=@Schedule(cron="*/3 * * * * *")) public void scheduledEvery3SecondsVoidReturn(int runs, ReqBean.RETURN type, AtomicInteger counter)
    • scheduledEvery3SecondsTakes5Seconds

      @Asynchronous(executor="java:comp/DefaultManagedScheduledExecutorService", runAt=@Schedule(cron="*/3 * * * * *")) public CompletableFuture<Integer> scheduledEvery3SecondsTakes5Seconds(int runs, AtomicInteger counter)
      A scheduled async method that runs every 3 seconds, but takes 5 seconds to complete
      Parameters:
      runs - - how many times to run before returning
      counter - - The counter provided from the caller to compare against
      Returns:
      The number of runs completed
    • scheduledEvery3Seconds

      @Asynchronous(executor="java:module/concurrent/ScheduledExecutorB", runAt=@Schedule(cron="*/3 * * * * *")) public CompletableFuture<Integer> scheduledEvery3Seconds(int runs, AtomicInteger counter)
      A scheduled async method that runs every 3 seconds Uses executor = "java:module/concurrent/ScheduledExecutorB" with max-async = 4
      Parameters:
      runs - - how many times to run before returning
      counter - - The counter provided from the caller to compare against
      Returns:
      completed future of IntContext
    • scheduledEvery3SecondsAnd1Minute

      @Asynchronous(executor="java:module/concurrent/ScheduledExecutorB",runAt={@Schedule(cron="*/3 * * * * *"),@Schedule(cron="0 * * * * *")}) public CompletableFuture<String> scheduledEvery3SecondsAnd1Minute(int runs, AtomicInteger counter)
      A scheduled async method that runs every 3 seconds and every minute Uses executor = "java:module/concurrent/ScheduledExecutorB" with max-async = 4
      Parameters:
      runs - - how many times to run before returning
      counter - - The counter provided from the caller to compare against
      Returns:
      completed future of StringContext
    • scheduledInvalidExecutor

      @Asynchronous(executor="java:app/concurrent/INVALID", runAt=@Schedule(cron="*/3 * * * * *")) public CompletableFuture<String> scheduledInvalidExecutor()
      A scheduled async method that should not run due to invalid configuration