private static final class ClosurePool.Handle extends java.lang.Object implements Closure.Handle
Closure.Handle interface.| Modifier and Type | Field and Description |
|---|---|
private boolean |
disposed |
(package private) ClosurePool.MagazineHolder |
holder
Keep references to the closure pool so it does not get garbage collected
until all closures using it do.
|
(package private) ClosurePool.Magazine.Slot |
slot |
| Constructor and Description |
|---|
Handle(ClosurePool.Magazine.Slot slot,
ClosurePool.MagazineHolder holder)
Creates a new Handle to lifecycle manager the native closure.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Releases the closure memory back to the operating system.
|
void |
free()
Deprecated.
|
long |
getAddress()
Gets the native code address of the closure.
|
void |
setAutoRelease(boolean autorelease)
Sets whether the closure memory should be released when the Handle is
garbage collected or not.
|
final ClosurePool.MagazineHolder holder
final ClosurePool.Magazine.Slot slot
private volatile boolean disposed
Handle(ClosurePool.Magazine.Slot slot, ClosurePool.MagazineHolder holder)
slot - THe magazine slot this handle belongs toholder - The magazine holder containing this handlepublic long getAddress()
Closure.HandlegetAddress in interface Closure.Handlepublic void setAutoRelease(boolean autorelease)
Closure.HandlesetAutoRelease in interface Closure.Handleautorelease - If true, the closure memory is automatically managed,
else the closure memory must be explicitly freed.@Deprecated public void free()
free in interface Closure.Handlepublic void dispose()
Closure.Handledispose in interface Closure.Handle