org.mozilla.jss.pkcs11
Class TokenProxy
public final class TokenProxy
TokenProxy(byte[] pointer) - Create a NativeProxy from a byte array representing a C pointer.
|
protected void | finalize() - Finalize this NativeProxy by releasing its native resources.
|
protected void | releaseNativeResources() - Release the native resources used by this proxy.
|
TokenProxy
public TokenProxy(byte[] pointer)
Create a NativeProxy from a byte array representing a C pointer.
This is the only way to create a NativeProxy, it should be called
from the constructor of your subclass.
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.
finalize
protected void finalize()
throws Throwable
Finalize this NativeProxy by releasing its native resources.
The finalizer calls releaseNativeResources() so you don't have to.
This finalizer should be called from the finalize() method of all
subclasses:
class MyProxy extends NativeProxy {
[...]
protected void finalize() throws Throwable {
// do any object-specific finalization other than
// releasing native resources
[...]
super.finalize();
}
}
- finalize in interface NativeProxy
releaseNativeResources
protected void releaseNativeResources()
Release the native resources used by this proxy.
Subclasses of NativeProxy must define this method to clean up
data structures in C code that are referenced by this proxy.
releaseNativeResources() will usually be implemented as a native method.
You don't call this method; NativeProxy.finalize() calls it for you.
You must declare a finalize() method which calls super.finalize().
- releaseNativeResources in interface NativeProxy