net.openhft.chronicle.core.Jvm.setExceptionHandlers()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(97)

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

Jvm.setExceptionHandlers介绍

暂无

代码示例

代码示例来源:origin: OpenHFT/Chronicle-Queue

public static void main(String[] args) {
  long start = System.currentTimeMillis();
  final TLogEntry entry = new TLogEntry();
  entry.setSessionId(321234L);
  entry.setLogLevel(77);
  entry.setSecurityLevel(1234);
  entry.setPosixTimestamp(6141234321L);
  entry.setMessage("This is a test message for the system................................ A");
  final LogEntryOutput output = new LogEntryOutput(1024);
  output.setMarshallable(entry);
  final ChronicleQueue queue = ChronicleQueue.singleBuilder(
      OS.TARGET + "/test-" + System.nanoTime())
      .rollCycle(RollCycles.HOURLY)
      .build();
  final ExcerptAppender appender = queue.acquireAppender();
  Jvm.setExceptionHandlers(Slf4jExceptionHandler.FATAL, Slf4jExceptionHandler.WARN, Slf4jExceptionHandler.WARN);
  for (int j = 0; j < 100; ++j) {
    for (int i = 0; i < 100000; ++i) {
      appender.writeBytes(output);
    }
    System.out.println((j + 1) * 100000);
    // Jvm.pause(100L);
  }
  queue.close();
  System.out.println("took " + (System.currentTimeMillis() - start) / 1e3);
}

代码示例来源:origin: OpenHFT/Chronicle-Core

@Deprecated
public static void setExceptionsHandlers(@Nullable ExceptionHandler fatal,
                     @Nullable ExceptionHandler warn,
                     @Nullable ExceptionHandler debug) {
  setExceptionHandlers(fatal, warn, debug);
}

代码示例来源:origin: net.openhft/chronicle-core

@Deprecated
public static void setExceptionsHandlers(@Nullable ExceptionHandler fatal,
                     @Nullable ExceptionHandler warn,
                     @Nullable ExceptionHandler debug) {
  setExceptionHandlers(fatal, warn, debug);
}

代码示例来源:origin: net.openhft/chronicle-core

public static void setExceptionHandlers(@Nullable ExceptionHandler fatal,
                    @Nullable ExceptionHandler warn,
                    @Nullable ExceptionHandler debug,
                    @Nullable ExceptionHandler perf) {
  setExceptionHandlers(fatal, warn, debug);
  PERF.defaultHandler(perf);
}

代码示例来源:origin: OpenHFT/Chronicle-Core

public static void setExceptionHandlers(@Nullable ExceptionHandler fatal,
                    @Nullable ExceptionHandler warn,
                    @Nullable ExceptionHandler debug,
                    @Nullable ExceptionHandler perf) {
  setExceptionHandlers(fatal, warn, debug);
  PERF.defaultHandler(perf);
}

相关文章