| Modifier and Type | Class and Description |
|---|---|
| private static class | ClosurePool.
Manages the lifecycle of a native closure. |
| private static class | |
| private static class | |
| pack-priv static class | ClosurePool.
This is a proxy passed to the native code, to be called by the native trampoline code. |
| Modifier and Type | Field and Description |
|---|---|
| private final CallContext | |
| private final ConcurrentLinkedQueue | |
| private final Set | |
| private static final Closure | |
| private final ConcurrentLinkedQueue |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private ClosurePool. | |
| public Closure. | |
| pack-priv synchronized void | |
| pack-priv void | |
| private void |
| callContext | back to summary |
|---|---|
| private final CallContext callContext | |
| freeQueue | back to summary |
|---|---|
| private final ConcurrentLinkedQueue<ClosurePool. | |
| magazines | back to summary |
|---|---|
| private final Set<ClosurePool. | |
| NULL_CLOSURE | back to summary |
|---|---|
| private static final Closure NULL_CLOSURE | |
| partialQueue | back to summary |
|---|---|
| private final ConcurrentLinkedQueue<ClosurePool. | |
| ClosurePool | back to summary |
|---|---|
| pack-priv ClosurePool(CallContext callContext) | |
| allocateNewHandle | back to summary |
|---|---|
| private ClosurePool. | |
| newClosureHandle | back to summary |
|---|---|
| public Closure. | |
| recycle | back to summary |
|---|---|
| pack-priv synchronized void recycle(ClosurePool. | |
| recycle | back to summary |
|---|---|
| pack-priv void recycle(ClosurePool. | |
| useMagazine | back to summary |
|---|---|
| private void useMagazine(ClosurePool. | |
Closure.Handle interface.
| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| pack-priv final ClosurePool. | holder
Keep references to the closure pool so it does not get garbage collected until all closures using it do. |
| pack-priv final ClosurePool. |
| Access | Constructor and Description |
|---|---|
| pack-priv | Handle(ClosurePool.
THe magazine slot this handle belongs to slot,The magazine holder containing this handle holderCreates a new Handle to lifecycle manager the native closure. |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | dispose()
Implements com. |
| public void | |
| public long | getAddress()
Implements com. |
| public void | setAutoRelease(boolean
If true, the closure memory is automatically managed,
else the closure memory must be explicitly freed. autorelease)Implements com. Handle is
garbage collected or not.
|
| disposed | back to summary |
|---|---|
| private volatile boolean disposed | |
| holder | back to summary |
|---|---|
| pack-priv final ClosurePool. Keep references to the closure pool so it does not get garbage collected until all closures using it do. | |
| slot | back to summary |
|---|---|
| pack-priv final ClosurePool. | |
| Handle | back to summary |
|---|---|
| pack-priv Handle(ClosurePool. Creates a new Handle to lifecycle manager the native closure.
| |
| dispose | back to summary |
|---|---|
| public synchronized void dispose() Implements com. Doc from com. Releases the closure memory back to the operating system.
Although the closure trampoline memory will normally be released when
the | |
| free | back to summary |
|---|---|
| public void free() Implements com. Deprecated
| |
| getAddress | back to summary |
|---|---|
| public long getAddress() Implements com. Doc from com. Gets the native code address of the closure. This can be passed into a native function that takes a function pointer.
| |
| setAutoRelease | back to summary |
|---|---|
| public void setAutoRelease(boolean autorelease) Implements com. Doc from com. Sets whether the closure memory should be released when the
| |
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private final CallContext | |
| private final Foreign | foreign
A handle to the foreign interface to keep it alive as long as this object is alive |
| private int | |
| private static final MemoryIO | IO
Store a reference to the MemoryIO accessor here for easy access |
| private final long | |
| private int | |
| private final ClosurePool. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | finalize()
Overrides java. |
| pack-priv ClosurePool. | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv void |
| ctx | back to summary |
|---|---|
| private final CallContext ctx | |
| foreign | back to summary |
|---|---|
| private final Foreign foreign A handle to the foreign interface to keep it alive as long as this object is alive
| |
| freeCount | back to summary |
|---|---|
| private int freeCount | |
| IO | back to summary |
|---|---|
| private static final MemoryIO IO Store a reference to the MemoryIO accessor here for easy access | |
| magazine | back to summary |
|---|---|
| private final long magazine | |
| next | back to summary |
|---|---|
| private int next | |
| slots | back to summary |
|---|---|
| private final ClosurePool. | |
| Magazine | back to summary |
|---|---|
| pack-priv Magazine(CallContext ctx) | |
| finalize | back to summary |
|---|---|
| protected void finalize() throws Throwable Overrides java. Doc from java. Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
A subclass overrides the
When running in a Java virtual machine in which finalization has been
disabled or removed, the garbage collector will never call
The general contract of
The
The Java programming language does not guarantee which thread will
invoke the
After the
The
Any exception thrown by the | |
| get | back to summary |
|---|---|
| pack-priv ClosurePool. | |
| isEmpty | back to summary |
|---|---|
| pack-priv boolean isEmpty() | |
| isFull | back to summary |
|---|---|
| pack-priv boolean isFull() | |
| recycle | back to summary |
|---|---|
| pack-priv void recycle() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile boolean | |
| pack-priv final long | codeAddress
The code trampoline address |
| pack-priv final long | handle
The address of the native closure structure Note This is NOT the code address, but a pointer to the structure which contains the code address. |
| pack-priv final ClosurePool. |
| Access | Constructor and Description |
|---|---|
| public |
| autorelease | back to summary |
|---|---|
| pack-priv volatile boolean autorelease | |
| codeAddress | back to summary |
|---|---|
| pack-priv final long codeAddress The code trampoline address | |
| handle | back to summary |
|---|---|
| pack-priv final long handle The address of the native closure structure Note This is NOT the code address, but a pointer to the structure which contains the code address. | |
| proxy | back to summary |
|---|---|
| pack-priv final ClosurePool. | |
| Slot | back to summary |
|---|---|
| public Slot(long handle, ClosurePool. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ClosurePool. | |
| pack-priv final ClosurePool |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | finalize()
Overrides java. |
| magazine | back to summary |
|---|---|
| pack-priv final ClosurePool. | |
| pool | back to summary |
|---|---|
| pack-priv final ClosurePool pool | |
| MagazineHolder | back to summary |
|---|---|
| public MagazineHolder(ClosurePool pool, ClosurePool. | |
| finalize | back to summary |
|---|---|
| protected void finalize() throws Throwable Overrides java. Doc from java. Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
A subclass overrides the
When running in a Java virtual machine in which finalization has been
disabled or removed, the garbage collector will never call
The general contract of
The
The Java programming language does not guarantee which thread will
invoke the
After the
The
Any exception thrown by the | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final CallContext | callContext
Keep references to the return and parameter types so they do not get garbage collected until the closure does. |
| pack-priv volatile Closure | |
| pack-priv static final Method |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static Method | Returns: The method to be invoked by native codeGets the Method to be invoked by native code |
| public void | invoke(long
The address of the native return value buffer retvalAddress, long The address of the native parameter buffer. paramAddress)Invoked by the native closure trampoline to execute the java side of the closure. |
| callContext | back to summary |
|---|---|
| pack-priv final CallContext callContext Keep references to the return and parameter types so they do not get garbage collected until the closure does. | |
| closure | back to summary |
|---|---|
| pack-priv volatile Closure closure | |
| METHOD | back to summary |
|---|---|
| pack-priv static final Method METHOD | |
| Proxy | back to summary |
|---|---|
| pack-priv Proxy(CallContext callContext) | |
| getMethod | back to summary |
|---|---|
| private static Method getMethod() Gets the Method to be invoked by native code
| |
| invoke | back to summary |
|---|---|
| public void invoke(long retvalAddress, long paramAddress) Invoked by the native closure trampoline to execute the java side of the closure.
| |