public abstract class CapiHandle
extends java.lang.Object
It is very important that the close method be called
after the object is no longer needed to free memory allocated by
native code. Not calling close can result in memory
leaks, and possibly even crash the Java VM.
Most toolkit users will not need to use this class directly.
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearHandle()
Clears the handle without freeing memory.
|
abstract void |
close()
Close the handle, releasing the memory allocated by CAPI functions.
|
static void |
debugInfo()
Writes information about current handle allocation to
System.out. |
static void |
debugInfo(boolean showAllocation)
Writes information about current handle allocation to
System.out. |
boolean |
equals(java.lang.Object anotherHandle)
Equals method, for debugging purposes.
|
protected void |
finalize()
Attempts to release the handle owned by this object.
|
protected long |
getHandle()
Returns the actual handle represented by this object.
|
int |
hashCode()
hashCode method, for debugging purposes.
|
static void |
setExtendedDebugging(boolean extendedDebugging)
Turn on or off extended debugging information.
|
public static void debugInfo()
System.out.
This method is useful for debugging memory allocation and making sure
resources allocated in native code are being correctly released.
This method is not guaranteed to remain in future toolkit versions, it should be used in debug code only.
public static void debugInfo(boolean showAllocation)
System.out.
This method is useful for debugging memory allocation and making sure
resources allocated in native code are being correctly released.
This method is not guaranteed to remain in future toolkit versions, it should be used in debug code only.
showAllocation - Show where handles were allocated, if the information is available.public static void setExtendedDebugging(boolean extendedDebugging)
This method is not guaranteed to remain in future toolkit versions, it should be used in debug code only.
extendedDebugging - public abstract void close()
It is okay to call this method multiple times on the same object.
protected long getHandle()
protected void clearHandle()
CertEnumCertificatesInStore.public boolean equals(java.lang.Object anotherHandle)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectprotected void finalize()
throws java.lang.Throwable
close
method when a handle is no longer required. This method is a
"last resort" to attempt to prevent memory leaks.finalize in class java.lang.Objectjava.lang.Throwable