Package org.openrewrite
Class InMemoryExecutionContext
- java.lang.Object
-
- org.openrewrite.InMemoryExecutionContext
-
- All Implemented Interfaces:
ExecutionContext
public class InMemoryExecutionContext extends java.lang.Object implements ExecutionContext
-
-
Constructor Summary
Constructors Constructor Description InMemoryExecutionContext()
InMemoryExecutionContext(java.util.function.Consumer<java.lang.Throwable> onError)
InMemoryExecutionContext(java.util.function.Consumer<java.lang.Throwable> onError, java.util.function.Function<java.lang.Integer,java.time.Duration> runTimeout)
InMemoryExecutionContext(java.util.function.Consumer<java.lang.Throwable> onError, java.util.function.Function<java.lang.Integer,java.time.Duration> runTimeout, java.util.function.BiConsumer<java.lang.Throwable,ExecutionContext> onTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getMessage(java.lang.String key)
java.util.function.Consumer<java.lang.Throwable>
getOnError()
java.util.function.BiConsumer<java.lang.Throwable,ExecutionContext>
getOnTimeout()
java.time.Duration
getRunTimeout(int inputs)
<T> T
pollMessage(java.lang.String key)
void
putMessage(java.lang.String key, java.lang.Object value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openrewrite.ExecutionContext
computeMessage, getMessage, pollMessage, putMessageInCollection, putMessageInSet
-
-
-
-
Constructor Detail
-
InMemoryExecutionContext
public InMemoryExecutionContext()
-
InMemoryExecutionContext
public InMemoryExecutionContext(java.util.function.Consumer<java.lang.Throwable> onError)
-
InMemoryExecutionContext
public InMemoryExecutionContext(java.util.function.Consumer<java.lang.Throwable> onError, java.util.function.Function<java.lang.Integer,java.time.Duration> runTimeout)
-
InMemoryExecutionContext
public InMemoryExecutionContext(java.util.function.Consumer<java.lang.Throwable> onError, java.util.function.Function<java.lang.Integer,java.time.Duration> runTimeout, java.util.function.BiConsumer<java.lang.Throwable,ExecutionContext> onTimeout)
-
-
Method Detail
-
putMessage
public void putMessage(java.lang.String key, java.lang.Object value)
- Specified by:
putMessage
in interfaceExecutionContext
-
getMessage
@Nullable public <T> T getMessage(java.lang.String key)
- Specified by:
getMessage
in interfaceExecutionContext
-
pollMessage
@Nullable public <T> T pollMessage(java.lang.String key)
- Specified by:
pollMessage
in interfaceExecutionContext
-
getOnError
public java.util.function.Consumer<java.lang.Throwable> getOnError()
- Specified by:
getOnError
in interfaceExecutionContext
-
getOnTimeout
public java.util.function.BiConsumer<java.lang.Throwable,ExecutionContext> getOnTimeout()
- Specified by:
getOnTimeout
in interfaceExecutionContext
-
getRunTimeout
public java.time.Duration getRunTimeout(int inputs)
- Specified by:
getRunTimeout
in interfaceExecutionContext
- Parameters:
inputs
- The number of inputs to the run. Allows the duration to be scaled to the number of inputs.- Returns:
- The maximum duration a run (e.g. parse operation, recipe run) can take.
-
-