public Cache() {
public Cache(String name) { this.name = name; Thread t = new Thread() { public void run() { while (true) { try { synchronized (signal) { signal.wait(); } while (true) { synchronized (Cache.this) { if (list.size() == 0) break; } Thread.sleep(2000); flush(); } } catch (InterruptedException e) { e.printStackTrace(); } } } }; t.start();
  public Cache() {  }