Exemplo n.º 1
0
  /** Invokes all cleanups registered with {@link #add}. */
  public static void cleanup() {
    final List cleanups;
    synchronized (_cleanups) {
      cleanups = new ArrayList(_cleanups);
    }

    for (Iterator it = cleanups.iterator(); it.hasNext(); ) {
      final Cleanup cleanup = (Cleanup) it.next();
      try {
        cleanup.cleanup();
      } catch (Throwable ex) {
        log.error("Failed to invoke " + cleanup);
      }
    }
  }
Exemplo n.º 2
0
 @Override
 public void close() throws Exception {
   cleanup.cleanup();
 }