edu.emory.mathcs.util.gc
Class FinalizationGroup

java.lang.Object
  extended byedu.emory.mathcs.util.gc.FinalizationGroup

public class FinalizationGroup
extends java.lang.Object

Allows grouping together finalizers of similar object types, so that they could e.g. be forcibly and collectively finalized upon VM exit.

Version:
1.0
Author:
Dawid Kurzyniec

Method Summary
 boolean addCompletionCallback(Callback cb)
           
 boolean areAllDone()
           
 void awaitAllDone()
           
 void awaitAllDone(long timeout, TimeUnit unit)
           
 boolean cancelAll(boolean mayInterruptIfRunning)
           
 void disable()
           
 boolean finalizeAll()
           
 FinalizationFuture registerFinalizer(java.lang.Object referrent, Finalizer finalizer)
           
 FinalizationFuture registerFinalizer(java.lang.Object referrent, Finalizer finalizer, boolean phantom)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

disable

public void disable()

registerFinalizer

public FinalizationFuture registerFinalizer(java.lang.Object referrent,
                                            Finalizer finalizer)

registerFinalizer

public FinalizationFuture registerFinalizer(java.lang.Object referrent,
                                            Finalizer finalizer,
                                            boolean phantom)

addCompletionCallback

public boolean addCompletionCallback(Callback cb)

areAllDone

public boolean areAllDone()

awaitAllDone

public void awaitAllDone()
                  throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

awaitAllDone

public void awaitAllDone(long timeout,
                         TimeUnit unit)
                  throws java.lang.InterruptedException,
                         TimeoutException
Throws:
java.lang.InterruptedException
TimeoutException

finalizeAll

public boolean finalizeAll()

cancelAll

public boolean cancelAll(boolean mayInterruptIfRunning)