Class DataLoaderInstrumentationHelper

java.lang.Object
org.dataloader.instrumentation.DataLoaderInstrumentationHelper

@PublicApi public class DataLoaderInstrumentationHelper extends Object
  • Field Details

  • Constructor Details

    • DataLoaderInstrumentationHelper

      public DataLoaderInstrumentationHelper()
  • Method Details

    • noOpCtx

      public static <T> DataLoaderInstrumentationContext<T> noOpCtx()
      Returns a noop DataLoaderInstrumentationContext of the right type
      Type Parameters:
      T - for two
      Returns:
      a noop context
    • whenDispatched

      public static <U> DataLoaderInstrumentationContext<U> whenDispatched(Runnable 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> DataLoaderInstrumentationContext<U> whenCompleted(BiConsumer<U,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
    • ctxOrNoopCtx

      public static <T> DataLoaderInstrumentationContext<T> ctxOrNoopCtx(DataLoaderInstrumentationContext<T> ic)
      Check the DataLoaderInstrumentationContext to see if its null and returns a noop if it is or else the original context. This is a bit of a helper method.
      Type Parameters:
      T - for two
      Parameters:
      ic - the context in play
      Returns:
      a non null context