Class ReqBean
java.lang.Object
ee.jakarta.tck.concurrent.spec.ManagedScheduledExecutorService.resourcedef.ReqBean
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionawaitAndGetThirdPartyContext
(Semaphore invocationsStarted, CountDownLatch blocker) scheduledEvery3Seconds
(int runs, AtomicInteger counter) A scheduled async method that runs every 3 seconds Uses executor = "java:module/concurrent/ScheduledExecutorB" with max-async = 4scheduledEvery3SecondsAnd1Minute
(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 = 4scheduledEvery3SecondsTakes5Seconds
(int runs, AtomicInteger counter) A scheduled async method that runs every 3 seconds, but takes 5 seconds to completevoid
scheduledEvery3SecondsVoidReturn
(int runs, ReqBean.RETURN type, AtomicInteger counter) scheduledEvery5seconds
(int runs, ReqBean.RETURN type, AtomicInteger counter) A scheduled async method that runs every 5 secondsA scheduled async method that should not run due to invalid configuration
-
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
-
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 returningtype
- - 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 returningcounter
- - 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 returningcounter
- - 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 returningcounter
- - 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
-