public abstract class NativeProxy
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
logger |
Modifier | Constructor and Description |
---|---|
|
NativeProxy(byte[] pointer)
Create a NativeProxy from a byte array representing a C pointer.
|
protected |
NativeProxy(byte[] pointer,
boolean track)
Create a NativeProxy from a byte array representing a C pointer.
|
Modifier and Type | Method and Description |
---|---|
static void |
assertRegistryEmpty()
Assert that the Registry is empty.
|
void |
clear()
Call clear(...) to clear the value of the pointer, setting it to null.
|
void |
close()
Close this NativeProxy by releasing its native resources if they
haven't otherwise been freed.
|
boolean |
equals(java.lang.Object obj)
Deep comparison operator.
|
protected void |
finalize()
Deprecated.
finalize() in Object has been deprecated. Use close(...)
from the AutoCloseable interface instead.
|
int |
hashCode()
Hash code based around mPointer value.
|
boolean |
isNull()
Whether or not this is a null pointer.
|
static void |
purgeAllInRegistry()
Unsafe: Purges all NativeProxies from memory.
|
protected abstract void |
releaseNativeResources()
Release the native resources used by this proxy.
|
java.lang.String |
toString() |
public NativeProxy(byte[] pointer)
pointer
- A byte array, created with JSS_ptrToByteArray, that
contains a pointer pointing to a native data structure. The
NativeProxy instance acts as a proxy for that native data structure.protected NativeProxy(byte[] pointer, boolean track)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
has the same underlying native
pointer. false if the obj
is null or has
a different underlying native pointer.public int hashCode()
hashCode
in class java.lang.Object
protected abstract void releaseNativeResources() throws java.lang.Exception
You don't call this method; NativeProxy.finalize() or close() calls it for you.
If you free these resources explicitly, call clear(); instead.java.lang.Exception
@Deprecated protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public final void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception
public final void clear()
public boolean isNull()
public java.lang.String toString()
toString
in class java.lang.Object
public static void assertRegistryEmpty()
public static void purgeAllInRegistry() throws java.lang.Exception
java.lang.Exception