Callback instances use native resources and must be explicitly freed when no longer used by calling the free method.
| Modifier and Type | Class and Description |
|---|---|
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private static final long | CALLBACK_HANDLER
Address of the native callback handler that will call the Java method when the native callback function is invoked. |
| private static final Callback. | |
| private static final boolean |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | Callback(long
the function address address)Creates a callback instance using the specified function address |
| Modifier and Type | Method and Description |
|---|---|
| public long | address()
Implements org. long value.
|
| pack-priv static long | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public void | free()
Implements org. |
| public static void | free(long
the function pointer functionPointer)Frees any resources held by the specified function pointer. |
| public static < the T extends CallbackI> TCallbackI instance type | Returns: theCallbackI instancea function pointer functionPointer)Converts the specified function pointer to the |
| private static native long | |
| public static <T extends CallbackI> T | |
| public int | |
| public String |
| address | back to summary |
|---|---|
| private long address | |
| CALLBACK_HANDLER | back to summary |
|---|---|
| private static final long CALLBACK_HANDLER Address of the native callback handler that will call the Java method when the native callback function is invoked. | |
| CLOSURE_REGISTRY | back to summary |
|---|---|
| private static final Callback. | |
| DEBUG_ALLOCATOR | back to summary |
|---|---|
| private static final boolean DEBUG_ALLOCATOR | |
| Callback | back to summary |
|---|---|
| protected Callback(FFICIF cif) Creates a callback instance using the specified libffi CIF.
| |
| Callback | back to summary |
|---|---|
| protected Callback(long address) Creates a callback instance using the specified function address
| |
| address | back to summary |
|---|---|
| public long address() Implements org. Doc from org. Returns the raw pointer address as a
| |
| create | back to summary |
|---|---|
| pack-priv static long create(FFICIF cif, Object instance) Creates a native function that delegates to the specified instance when called. The native function uses the default calling convention. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| free | back to summary |
|---|---|
| public void free() Implements org. Doc from org. Frees any native resources held by this object.
| |
| free | back to summary |
|---|---|
| public static void free(long functionPointer) Frees any resources held by the specified function pointer.
| |
| get | back to summary |
|---|---|
| public static <T extends CallbackI> T get(long functionPointer) Converts the specified function pointer to the
| |
| getCallbackHandler | back to summary |
|---|---|
| private static native long getCallbackHandler(Method callback) | |
| getSafe | back to summary |
|---|---|
| public static <T extends CallbackI> T getSafe(long functionPointer) Like
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Method and Description |
|---|---|
| public FFIClosure | |
| public void | |
| public FFIClosure |
| get | back to summary |
|---|---|
| public FFIClosure get(long executableAddress) | |
| put | back to summary |
|---|---|
| public void put(long executableAddress, FFIClosure closure) | |
| remove | back to summary |
|---|---|
| public FFIClosure remove(long executableAddress) | |