public class Cleaner
extends java.lang.Object
References are normally released when the Java object is garbage collected. However, there are times when you want to force the release.
Consider the case where your object is a proxy to a RasterDataset that you are editing. The object may not be garbage collected for some time. Until it is, the RasterDataset may hold onto any files it is writing to, and the updates might not get flushed to the file. The files might remain in use and cannot be deleted till references to the object are released.
By explicitly calling release, the RasterDataset will free the resources it was using, and do any required clean-up tasks. At some time later, the Java object will be garbage collected.
Constructor and Description |
---|
Cleaner() |
Modifier and Type | Method and Description |
---|---|
static void |
release(java.lang.Object anObject)
Releases a specific reference to an arcobject.
|
static void |
releaseAll()
Releases all outstanding references to arcobjects.
|
static void |
releaseAllInCurrentThread()
Tells the runtime to release all objects used in the current thread since
the last 'trackObjectsInCurrentThread' call.
|
static void |
trackObjectsInCurrentThread()
Tells the runtime to remember all objects used in the current thread.
|
public static void releaseAll()
public static void trackObjectsInCurrentThread()
Cleaner.releaseAllInCurrentThread()
public static void releaseAllInCurrentThread()
Cleaner.trackObjectsInCurrentThread()
public static void release(java.lang.Object anObject)
anObject
- the object to be releasedjava.lang.IllegalArgumentException
- if the object that is passed is not a reference to an arcobject.