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> TgetMessage(java.lang.String key)java.util.function.Consumer<java.lang.Throwable>getOnError()java.util.function.BiConsumer<java.lang.Throwable,ExecutionContext>getOnTimeout()java.time.DurationgetRunTimeout(int inputs)<T> TpollMessage(java.lang.String key)voidputMessage(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:
putMessagein interfaceExecutionContext
-
getMessage
@Nullable public <T> T getMessage(java.lang.String key)
- Specified by:
getMessagein interfaceExecutionContext
-
pollMessage
@Nullable public <T> T pollMessage(java.lang.String key)
- Specified by:
pollMessagein interfaceExecutionContext
-
getOnError
public java.util.function.Consumer<java.lang.Throwable> getOnError()
- Specified by:
getOnErrorin interfaceExecutionContext
-
getOnTimeout
public java.util.function.BiConsumer<java.lang.Throwable,ExecutionContext> getOnTimeout()
- Specified by:
getOnTimeoutin interfaceExecutionContext
-
getRunTimeout
public java.time.Duration getRunTimeout(int inputs)
- Specified by:
getRunTimeoutin 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.
-
-