reactor.core.publisher.Hooks.addAssemblyInfo()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(185)

本文整理了Java中reactor.core.publisher.Hooks.addAssemblyInfo()方法的一些代码示例,展示了Hooks.addAssemblyInfo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hooks.addAssemblyInfo()方法的具体详情如下:
包路径:reactor.core.publisher.Hooks
类名称:Hooks
方法名:addAssemblyInfo

Hooks.addAssemblyInfo介绍

暂无

代码示例

代码示例来源:origin: reactor/reactor-core

/**
 * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
 * {@link ConnectableFlux}, potentially returning a new {@link ConnectableFlux}. This
 * is for example useful to activate cross-cutting concerns at assembly time, eg. a
 * generalized {@link #checkpoint()}.
 *
 * @param <T> the value type
 * @param source the source to apply assembly hooks onto
 *
 * @return the source, potentially wrapped with assembly time cross-cutting behavior
 */
@SuppressWarnings("unchecked")
protected static <T> ConnectableFlux<T> onAssembly(ConnectableFlux<T> source) {
  Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  if(hook != null) {
    source = (ConnectableFlux<T>) hook.apply(source);
  }
  if (Hooks.GLOBAL_TRACE) {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    source = (ConnectableFlux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  }
  return source;
}

代码示例来源:origin: reactor/reactor-core

/**
 * Invoke {@link Hooks} pointcut given a {@link ParallelFlux} and returning an
 * eventually new {@link ParallelFlux}
 *
 * @param <T> the value type
 * @param source the source to wrap
 *
 * @return the potentially wrapped source
 */
@SuppressWarnings("unchecked")
protected static <T> ParallelFlux<T> onAssembly(ParallelFlux<T> source) {
  Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  if(hook != null) {
    source = (ParallelFlux<T>) hook.apply(source);
  }
  if (Hooks.GLOBAL_TRACE) {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    source = (ParallelFlux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  }
  return source;
}

代码示例来源:origin: reactor/reactor-core

/**
 * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
 * {@link Mono}, potentially returning a new {@link Mono}. This is for example useful
 * to activate cross-cutting concerns at assembly time, eg. a generalized
 * {@link #checkpoint()}.
 *
 * @param <T> the value type
 * @param source the source to apply assembly hooks onto
 *
 * @return the source, potentially wrapped with assembly time cross-cutting behavior
 */
@SuppressWarnings("unchecked")
protected static <T> Mono<T> onAssembly(Mono<T> source) {
  Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  if(hook != null) {
    source = (Mono<T>) hook.apply(source);
  }
  if (Hooks.GLOBAL_TRACE) {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    source = (Mono<T>) Hooks.addAssemblyInfo(source, stacktrace);
  }
  return source;
}

代码示例来源:origin: reactor/reactor-core

/**
 * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
 * {@link Flux}, potentially returning a new {@link Flux}. This is for example useful
 * to activate cross-cutting concerns at assembly time, eg. a generalized
 * {@link #checkpoint()}.
 *
 * @param <T> the value type
 * @param source the source to apply assembly hooks onto
 *
 * @return the source, potentially wrapped with assembly time cross-cutting behavior
 */
@SuppressWarnings("unchecked")
protected static <T> Flux<T> onAssembly(Flux<T> source) {
  Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  if(hook != null) {
    source = (Flux<T>) hook.apply(source);
  }
  if (Hooks.GLOBAL_TRACE) {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    source = (Flux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  }
  return source;
}

代码示例来源:origin: io.projectreactor/reactor-core

/**
 * Invoke {@link Hooks} pointcut given a {@link ParallelFlux} and returning an
 * eventually new {@link ParallelFlux}
 *
 * @param <T> the value type
 * @param source the source to wrap
 *
 * @return the potentially wrapped source
 */
@SuppressWarnings("unchecked")
protected static <T> ParallelFlux<T> onAssembly(ParallelFlux<T> source) {
  Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  if(hook != null) {
    source = (ParallelFlux<T>) hook.apply(source);
  }
  if (Hooks.GLOBAL_TRACE) {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    source = (ParallelFlux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  }
  return source;
}

代码示例来源:origin: io.projectreactor/reactor-core

/**
 * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
 * {@link Flux}, potentially returning a new {@link Flux}. This is for example useful
 * to activate cross-cutting concerns at assembly time, eg. a generalized
 * {@link #checkpoint()}.
 *
 * @param <T> the value type
 * @param source the source to apply assembly hooks onto
 *
 * @return the source, potentially wrapped with assembly time cross-cutting behavior
 */
@SuppressWarnings("unchecked")
protected static <T> Flux<T> onAssembly(Flux<T> source) {
  Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  if(hook != null) {
    source = (Flux<T>) hook.apply(source);
  }
  if (Hooks.GLOBAL_TRACE) {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    source = (Flux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  }
  return source;
}

代码示例来源:origin: io.projectreactor/reactor-core

/**
 * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
 * {@link Mono}, potentially returning a new {@link Mono}. This is for example useful
 * to activate cross-cutting concerns at assembly time, eg. a generalized
 * {@link #checkpoint()}.
 *
 * @param <T> the value type
 * @param source the source to apply assembly hooks onto
 *
 * @return the source, potentially wrapped with assembly time cross-cutting behavior
 */
@SuppressWarnings("unchecked")
protected static <T> Mono<T> onAssembly(Mono<T> source) {
  Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  if(hook != null) {
    source = (Mono<T>) hook.apply(source);
  }
  if (Hooks.GLOBAL_TRACE) {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    source = (Mono<T>) Hooks.addAssemblyInfo(source, stacktrace);
  }
  return source;
}

代码示例来源:origin: io.projectreactor/reactor-core

/**
 * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
 * {@link ConnectableFlux}, potentially returning a new {@link ConnectableFlux}. This
 * is for example useful to activate cross-cutting concerns at assembly time, eg. a
 * generalized {@link #checkpoint()}.
 *
 * @param <T> the value type
 * @param source the source to apply assembly hooks onto
 *
 * @return the source, potentially wrapped with assembly time cross-cutting behavior
 */
@SuppressWarnings("unchecked")
protected static <T> ConnectableFlux<T> onAssembly(ConnectableFlux<T> source) {
  Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  if(hook != null) {
    source = (ConnectableFlux<T>) hook.apply(source);
  }
  if (Hooks.GLOBAL_TRACE) {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    source = (ConnectableFlux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  }
  return source;
}

相关文章