Exemplo n.º 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 (; ; ) ;
  }
Exemplo n.º 2
0
 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);
   }
 }