예제 #1
0
파일: Jobs.java 프로젝트: superkoh/rapidoid
  public static synchronized ScheduledExecutorService scheduler() {
    if (SCHEDULER == null) {
      int threads = Conf.option("threads", 100);
      SCHEDULER = Executors.newScheduledThreadPool(threads / 2, new RapidoidThreadFactory("jobs"));
    }

    return SCHEDULER;
  }
예제 #2
0
파일: Jobs.java 프로젝트: superkoh/rapidoid
  public static synchronized Executor executor() {
    if (EXECUTOR == null) {
      int threads = Conf.option("threads", 100);
      EXECUTOR = Executors.newFixedThreadPool(threads);
    }

    return EXECUTOR;
  }
예제 #3
0
  @Test
  public void testSecret() {
    notNull(Crypto.secret());
    isTrue(Crypto.secret() == Crypto.secret());

    // default secret in dev mode is an empty string
    eq(Crypto.secret(), "");

    Conf.args("secret=mysecret");
    eq(Crypto.secret(), "mysecret");
  }