org.aspectj.lang.Aspects.aspectOf()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(254)

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

Aspects.aspectOf介绍

[英]Returns the singleton aspect or the percflow / percflowbelow associated with the current thread
[中]返回与当前线程关联的单例方面或percflow/percflow

代码示例

代码示例来源:origin: dsyer/spring-boot-aspectj

@Bean
public Interceptor interceptor() {
  // This will barf at runtime if the weaver isn't working (probably a
  // good thing)
  return Aspects.aspectOf(Interceptor.class);
}

代码示例来源:origin: dsyer/spring-boot-aspectj

@Bean
public Interceptor interceptor() {
  // This will barf at runtime if the weaver isn't working (probably a
  // good thing)
  return Aspects.aspectOf(Interceptor.class);
}

代码示例来源:origin: dsyer/spring-boot-aspectj

@Bean
public Interceptor interceptor() {
  // This will barf at runtime if the weaver isn't working (probably a
  // good thing)
  return Aspects.aspectOf(Interceptor.class);
}

代码示例来源:origin: dsyer/spring-boot-aspectj

@Bean
public Interceptor interceptor() {
  // This will barf at runtime if the weaver isn't working (probably a
  // good thing)
  return Aspects.aspectOf(Interceptor.class);
}

代码示例来源:origin: dsyer/spring-boot-aspectj

@Bean
@Conditional(AspectsCondition.class)
@ConditionalOnClass(name = "org.aspectj.lang.Aspects")
public TimingInterceptor timingInterceptor() {
  return Aspects.aspectOf(TimingInterceptor.class);
}

代码示例来源:origin: com.arcbees/testutils

@Override
  protected void configure() {
    bind(org.openqa.selenium.support.pagefactory.ElementLocatorFactory.class)
        .to(ElementLocatorFactory.class)
        .in(Singleton.class);

    bind(WebDriver.class).toProvider(WebDriverProvider.class);
    bind(WebDriverProvider.class).in(Singleton.class);
    requestInjection(aspectOf(CurrentScenarioAspect.class));
  }
}

代码示例来源:origin: CodingFabian/SamplingVsInstrumentation

private static void instrumentDemo(final DemoType type) {
    long startMain = System.nanoTime();
    TraceAspect trace = Aspects.aspectOf(TraceAspect.class);
    trace.init();

    long startCode = System.nanoTime();

    runDemo(type);

    long endCode = System.nanoTime();
    System.out.printf("%s Demo completed in %dms%n", type,
        Time.nsToMs(endCode - startCode));

    trace.printStatistics();
    long endMain = System.nanoTime();
    System.out.printf("Agent Overhead %dms%n",
        Time.nsToMs((endMain - startMain) - (endCode - startCode)));
  }
}

代码示例来源:origin: org.parallelj/parallelj-core

/**
 * Return the values of the attributes
 * 
 * @param executable
 *            an instance of a class annotated by {@link Program} or by
 *            {@link Executable}
 * @return the values of the attributes or an empty map if the parameter is
 *         <code>null</code> or if the class is not annotated by
 *         {@link Program} or by {@link Executable}
 */
public static Map<String, String> attributes(Object executable) {
  if (executable == null
      || !Aspects.hasAspect(PerExecutable.class,
          executable.getClass())) {
    return empty;
  }
  PerExecutable perExecutable = Aspects.aspectOf(PerExecutable.class,
      executable.getClass());
  if (perExecutable.executable != null) {
    return perExecutable.executable.values(executable);
  } else {
    return empty;
  }
}

代码示例来源:origin: dsyer/spring-boot-allocations

public static void main(String[] args) {
  // FuncState state = new FuncState();
  // UnprocessorState state = new UnprocessorState();
  ProcessorState state = new ProcessorState();
  state.start();
  //SimpleState state = new SimpleState();
  state.run();
  Aspects.aspectOf(CallCounter.class).log();
}

相关文章