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

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

本文整理了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

  1. /**
  2. * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
  3. * {@link ConnectableFlux}, potentially returning a new {@link ConnectableFlux}. This
  4. * is for example useful to activate cross-cutting concerns at assembly time, eg. a
  5. * generalized {@link #checkpoint()}.
  6. *
  7. * @param <T> the value type
  8. * @param source the source to apply assembly hooks onto
  9. *
  10. * @return the source, potentially wrapped with assembly time cross-cutting behavior
  11. */
  12. @SuppressWarnings("unchecked")
  13. protected static <T> ConnectableFlux<T> onAssembly(ConnectableFlux<T> source) {
  14. Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  15. if(hook != null) {
  16. source = (ConnectableFlux<T>) hook.apply(source);
  17. }
  18. if (Hooks.GLOBAL_TRACE) {
  19. AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  20. source = (ConnectableFlux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  21. }
  22. return source;
  23. }

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

  1. /**
  2. * Invoke {@link Hooks} pointcut given a {@link ParallelFlux} and returning an
  3. * eventually new {@link ParallelFlux}
  4. *
  5. * @param <T> the value type
  6. * @param source the source to wrap
  7. *
  8. * @return the potentially wrapped source
  9. */
  10. @SuppressWarnings("unchecked")
  11. protected static <T> ParallelFlux<T> onAssembly(ParallelFlux<T> source) {
  12. Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  13. if(hook != null) {
  14. source = (ParallelFlux<T>) hook.apply(source);
  15. }
  16. if (Hooks.GLOBAL_TRACE) {
  17. AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  18. source = (ParallelFlux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  19. }
  20. return source;
  21. }

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

  1. /**
  2. * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
  3. * {@link Mono}, potentially returning a new {@link Mono}. This is for example useful
  4. * to activate cross-cutting concerns at assembly time, eg. a generalized
  5. * {@link #checkpoint()}.
  6. *
  7. * @param <T> the value type
  8. * @param source the source to apply assembly hooks onto
  9. *
  10. * @return the source, potentially wrapped with assembly time cross-cutting behavior
  11. */
  12. @SuppressWarnings("unchecked")
  13. protected static <T> Mono<T> onAssembly(Mono<T> source) {
  14. Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  15. if(hook != null) {
  16. source = (Mono<T>) hook.apply(source);
  17. }
  18. if (Hooks.GLOBAL_TRACE) {
  19. AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  20. source = (Mono<T>) Hooks.addAssemblyInfo(source, stacktrace);
  21. }
  22. return source;
  23. }

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

  1. /**
  2. * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
  3. * {@link Flux}, potentially returning a new {@link Flux}. This is for example useful
  4. * to activate cross-cutting concerns at assembly time, eg. a generalized
  5. * {@link #checkpoint()}.
  6. *
  7. * @param <T> the value type
  8. * @param source the source to apply assembly hooks onto
  9. *
  10. * @return the source, potentially wrapped with assembly time cross-cutting behavior
  11. */
  12. @SuppressWarnings("unchecked")
  13. protected static <T> Flux<T> onAssembly(Flux<T> source) {
  14. Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  15. if(hook != null) {
  16. source = (Flux<T>) hook.apply(source);
  17. }
  18. if (Hooks.GLOBAL_TRACE) {
  19. AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  20. source = (Flux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  21. }
  22. return source;
  23. }

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

  1. /**
  2. * Invoke {@link Hooks} pointcut given a {@link ParallelFlux} and returning an
  3. * eventually new {@link ParallelFlux}
  4. *
  5. * @param <T> the value type
  6. * @param source the source to wrap
  7. *
  8. * @return the potentially wrapped source
  9. */
  10. @SuppressWarnings("unchecked")
  11. protected static <T> ParallelFlux<T> onAssembly(ParallelFlux<T> source) {
  12. Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  13. if(hook != null) {
  14. source = (ParallelFlux<T>) hook.apply(source);
  15. }
  16. if (Hooks.GLOBAL_TRACE) {
  17. AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  18. source = (ParallelFlux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  19. }
  20. return source;
  21. }

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

  1. /**
  2. * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
  3. * {@link Flux}, potentially returning a new {@link Flux}. This is for example useful
  4. * to activate cross-cutting concerns at assembly time, eg. a generalized
  5. * {@link #checkpoint()}.
  6. *
  7. * @param <T> the value type
  8. * @param source the source to apply assembly hooks onto
  9. *
  10. * @return the source, potentially wrapped with assembly time cross-cutting behavior
  11. */
  12. @SuppressWarnings("unchecked")
  13. protected static <T> Flux<T> onAssembly(Flux<T> source) {
  14. Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  15. if(hook != null) {
  16. source = (Flux<T>) hook.apply(source);
  17. }
  18. if (Hooks.GLOBAL_TRACE) {
  19. AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  20. source = (Flux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  21. }
  22. return source;
  23. }

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

  1. /**
  2. * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
  3. * {@link Mono}, potentially returning a new {@link Mono}. This is for example useful
  4. * to activate cross-cutting concerns at assembly time, eg. a generalized
  5. * {@link #checkpoint()}.
  6. *
  7. * @param <T> the value type
  8. * @param source the source to apply assembly hooks onto
  9. *
  10. * @return the source, potentially wrapped with assembly time cross-cutting behavior
  11. */
  12. @SuppressWarnings("unchecked")
  13. protected static <T> Mono<T> onAssembly(Mono<T> source) {
  14. Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  15. if(hook != null) {
  16. source = (Mono<T>) hook.apply(source);
  17. }
  18. if (Hooks.GLOBAL_TRACE) {
  19. AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  20. source = (Mono<T>) Hooks.addAssemblyInfo(source, stacktrace);
  21. }
  22. return source;
  23. }

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

  1. /**
  2. * To be used by custom operators: invokes assembly {@link Hooks} pointcut given a
  3. * {@link ConnectableFlux}, potentially returning a new {@link ConnectableFlux}. This
  4. * is for example useful to activate cross-cutting concerns at assembly time, eg. a
  5. * generalized {@link #checkpoint()}.
  6. *
  7. * @param <T> the value type
  8. * @param source the source to apply assembly hooks onto
  9. *
  10. * @return the source, potentially wrapped with assembly time cross-cutting behavior
  11. */
  12. @SuppressWarnings("unchecked")
  13. protected static <T> ConnectableFlux<T> onAssembly(ConnectableFlux<T> source) {
  14. Function<Publisher, Publisher> hook = Hooks.onEachOperatorHook;
  15. if(hook != null) {
  16. source = (ConnectableFlux<T>) hook.apply(source);
  17. }
  18. if (Hooks.GLOBAL_TRACE) {
  19. AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  20. source = (ConnectableFlux<T>) Hooks.addAssemblyInfo(source, stacktrace);
  21. }
  22. return source;
  23. }

相关文章