Class SimpleInstrumentationContext<T>

    • Constructor Detail

      • SimpleInstrumentationContext

        public SimpleInstrumentationContext()
    • Method Detail

      • noOp

        public static <T> InstrumentationContext<T> noOp()
        A context that does nothing
        Type Parameters:
        T - the type needed
        Returns:
        a context that does nothing
      • onDispatched

        public void onDispatched​(java.util.concurrent.CompletableFuture<T> result)
        Description copied from interface: InstrumentationContext
        This is invoked when the instrumentation step is initially dispatched
        Specified by:
        onDispatched in interface InstrumentationContext<T>
        Parameters:
        result - the result of the step as a completable future
      • onCompleted

        public void onCompleted​(T result,
                                java.lang.Throwable t)
        Description copied from interface: InstrumentationContext
        This is invoked when the instrumentation step is fully completed
        Specified by:
        onCompleted in interface InstrumentationContext<T>
        Parameters:
        result - the result of the step (which may be null)
        t - this exception will be non null if an exception was thrown during the step
      • whenDispatched

        public static <U> SimpleInstrumentationContext<U> whenDispatched​(java.util.function.Consumer<java.util.concurrent.CompletableFuture<U>> codeToRun)
        Allows for the more fluent away to return an instrumentation context that runs the specified code on instrumentation step dispatch.
        Type Parameters:
        U - the generic type
        Parameters:
        codeToRun - the code to run on dispatch
        Returns:
        an instrumentation context
      • whenCompleted

        public static <U> SimpleInstrumentationContext<U> whenCompleted​(java.util.function.BiConsumer<U,​java.lang.Throwable> codeToRun)
        Allows for the more fluent away to return an instrumentation context that runs the specified code on instrumentation step completion.
        Type Parameters:
        U - the generic type
        Parameters:
        codeToRun - the code to run on completion
        Returns:
        an instrumentation context
      • completeInstrumentationCtxCF

        public static <T> java.util.function.BiConsumer<? super T,​? super java.lang.Throwable> completeInstrumentationCtxCF​(InstrumentationContext<T> instrumentationContext,
                                                                                                                                  java.util.concurrent.CompletableFuture<T> targetCF)