Package org.openrewrite
Interface ExecutionContext
- All Known Implementing Classes:
AIExecutionContextView
,DelegatingExecutionContext
,HttpSenderExecutionContextView
,InMemoryExecutionContext
,ParsingExecutionContextView
,RemoteExecutionContextView
,WatchableExecutionContext
public interface ExecutionContext
Passes messages between individual visitors or parsing operations and allows errors to be propagated
back to the process controlling parsing or recipe execution.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault ExecutionContext
addObserver
(TreeObserver.Subscription observer) default <V,
T> T computeMessage
(String key, V value, Supplier<T> defaultValue, BiFunction<V, ? super T, ? extends T> remappingFunction) default int
getCycle()
<T> T
getMessage
(String key) default <T> T
getMessage
(String key, T defaultValue) default Set<TreeObserver.Subscription>
<T> T
pollMessage
(String key) default <T> T
pollMessage
(String key, T defaultValue) default void
putCurrentRecipe
(Recipe recipe) void
putMessage
(String key, @Nullable Object value) default <V,
C extends Collection<V>>
CputMessageInCollection
(String key, V value, Supplier<C> newCollection) default <T> Set<T>
putMessageInSet
(String key, T value)
-
Field Details
-
CURRENT_CYCLE
- See Also:
-
CURRENT_RECIPE
- See Also:
-
DATA_TABLES
- See Also:
-
RUN_TIMEOUT
- See Also:
-
-
Method Details
-
addObserver
@Incubating(since="7.20.0") default ExecutionContext addObserver(TreeObserver.Subscription observer) -
getObservers
-
putMessage
-
getMessage
-
computeMessage
default <V,T> T computeMessage(String key, V value, Supplier<T> defaultValue, BiFunction<V, ? super T, ? extends T> remappingFunction) -
putMessageInCollection
default <V,C extends Collection<V>> C putMessageInCollection(String key, V value, Supplier<C> newCollection) -
putMessageInSet
-
getMessage
-
pollMessage
-
pollMessage
-
putCurrentRecipe
-
getOnError
-
getOnTimeout
BiConsumer<Throwable,ExecutionContext> getOnTimeout() -
getCycle
default int getCycle()
-