Class AppBean
java.lang.Object
ee.jakarta.tck.concurrent.spec.ManagedExecutorService.resourcedef.AppBean
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddStringContextAndWait
(BlockingQueue<String> queue, CountDownLatch blocker) void
scheduledEvery3Seconds
(int runs, AtomicInteger counter) A scheduled async method that runs every 3 seconds Uses executor = "java:module/concurrent/ExecutorB" with max-async = 1scheduledEvery3SecondsAnd1Minute
(int runs, AtomicInteger counter) A scheduled async method that runs every 3 seconds and every minute Uses executor = "java:app/concurrent/ExecutorA" with max-async = 1scheduledEvery3SecondsTakes5Seconds
(int runs, AtomicInteger counter) A scheduled async method that runs every 3 seconds, but takes 5 seconds to completevoid
scheduledEvery3SecondsVoidReturn
(int runs, AppBean.RETURN type, AtomicInteger counter) scheduledEvery5seconds
(int runs, AppBean.RETURN type, AtomicInteger counter) A scheduled async method that runs every 5 secondsA scheduled async method that should not run due to invalid configurationwaitAndGetIntContext
(Semaphore started, CountDownLatch blocker)
-
Constructor Details
-
AppBean
public AppBean()
-
-
Method Details
-
addStringContextAndWait
@Asynchronous(executor="java:module/concurrent/ExecutorB") public CompletionStage<String> addStringContextAndWait(BlockingQueue<String> queue, CountDownLatch blocker) -
exchange
-
waitAndGetIntContext
@Asynchronous(executor="java:app/concurrent/ExecutorA") public CompletableFuture<Integer> waitAndGetIntContext(Semaphore started, CountDownLatch blocker) -
scheduledEvery5seconds
@Asynchronous(runAt=@Schedule(cron="*/5 * * * * *")) public CompletableFuture<Integer> scheduledEvery5seconds(int runs, AppBean.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(runAt=@Schedule(cron="*/3 * * * * *")) public void scheduledEvery3SecondsVoidReturn(int runs, AppBean.RETURN type, AtomicInteger counter) -
scheduledEvery3SecondsTakes5Seconds
@Asynchronous(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/ExecutorB", 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/ExecutorB" with max-async = 1- 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/ExecutorB",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:app/concurrent/ExecutorA" with max-async = 1- 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
-