public class ThreadLocalRunners<RUNNER extends TaskRunner> extends Object
| Constructor and Description |
|---|
ThreadLocalRunners() |
| Modifier and Type | Method and Description |
|---|---|
void |
firstInterceptWith(Supplier<RUNNER> fn)
Adds a TaskRunner to each new Orchestrator at the head of the list.
|
void |
firstInterceptWith(Supplier<RUNNER> fn,
BiPredicate<Orchestrator,Object> pred)
Adds a TaskRunner to each new Orchestrator at the head of the list if the supplied predicate is true.
|
RUNNER |
getAndClear()
Returns the TaskRunner last generated by the supplier function to
firstInterceptWith(Supplier)
or firstInterceptWith(Supplier, BiPredicate) for this thread. |
void |
lastInterceptWith(Supplier<RUNNER> fn)
Adds a TaskRunner to each new Orchestrator to the tail of the list.
|
void |
lastInterceptWith(Supplier<RUNNER> fn,
BiPredicate<Orchestrator,Object> pred)
Adds a TaskRunner to each new Orchestrator to the tail of the list if the supplied predicate is true.
|
public void firstInterceptWith(Supplier<RUNNER> fn)
fn - to generate the TaskRunner to addpublic void lastInterceptWith(Supplier<RUNNER> fn)
fn - to generate the TaskRunner to addpublic void firstInterceptWith(Supplier<RUNNER> fn, BiPredicate<Orchestrator,Object> pred)
GlobalOrchestratorConfig.Config.afterDefaultInitialization(Orchestrator, Object).fn - to generate the TaskRunner to addpublic void lastInterceptWith(Supplier<RUNNER> fn, BiPredicate<Orchestrator,Object> pred)
GlobalOrchestratorConfig.Config.afterDefaultInitialization(Orchestrator, Object).fn - to generate the TaskRunner to addpublic RUNNER getAndClear()
firstInterceptWith(Supplier)
or firstInterceptWith(Supplier, BiPredicate) for this thread. If more than one Orchestrator
was created for this thread since one of those methods was called, this will only return the last one.Copyright © 2021. All rights reserved.