예제 #1
0
  private static void check(MimeType type, String str) throws Exception {
    References references;

    Node node = WORLD.getTemp().createTempFile();
    node.writeString(str);
    references = References.create(type, true, node);
    references.readBytes();
    node.deleteFile();

    System.gc();
    Thread.sleep(1000);

    System.out.println("Startup done");
    Thread.sleep(20000);
    System.out.println("computing ...");

    node = WORLD.getTemp().createTempFile();
    node.writeString(str);
    references = References.create(type, true, node);
    references.readBytes();
    node.deleteFile();

    System.out.println("busy wait to keep references");
    for (; ; ) ;
  }
예제 #2
0
파일: LogDirectory.java 프로젝트: gelli/joe
 public void save(String json, String action, String method) {
   try {
     Node file = methodDirectory(method).join(filename(action, ".log"));
     file.writeString(json);
   } catch (IOException e) {
     throw new RuntimeException("ToDo: Handle this", e);
   }
 }