|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.GCBarrier
public class GCBarrier
A class which maintains references to other objects behind
a garbage collection barrier. Any object added via the
preventGarbageCollection(java.lang.Object)
method will not be garbage collected.
This is useful especially for certain
classes which you do not want collected
since reloading them may break them. This may be necessary if
a class' static initializers must only be executed once per
Java Virtual Machine process.
For example, this class has a static initializer block which does:
static { GCBarrier.preventGarbageCollection(com.sas.util.GCBarrier.class); }
Method Summary | |
---|---|
static void |
allowGarbageCollection(java.lang.Object object)
Allow an object that had been prevented from being garbage collected to be collected. |
static void |
preventGarbageCollection(java.lang.Object object)
Prevent an object from being garbage collected by saving a reference to it in non-collected space. |
Method Detail |
---|
public static void preventGarbageCollection(java.lang.Object object)
object
- the object you don't want collected.public static void allowGarbageCollection(java.lang.Object object)
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |