Subclassed from PhantomCleanable so that clear can be
called to disable the cleanup when the handle is closed by any means other
than calling FileDescriptor#close.
Otherwise, it might incorrectly close the handle after it has been reused.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private static final JavaIOFileDescriptorAccess | |
| private final long |
| Access | Constructor and Description |
|---|---|
| private | FileCleanable(FileDescriptor
the object to monitor obj, Cleaner the cleaner cleaner, int file descriptor to close fd, long handle to close handle)Constructor for a phantom cleanable reference. |
| Modifier and Type | Method and Description |
|---|---|
| private static native void | |
| protected void | performCleanup()
Implements abstract jdk. Close the native handle or fd. |
| pack-priv static void | register(FileDescriptor
the FileDescriptor; may be null fdo)Register a Cleanable with the FileDescriptor if the FileDescriptor is non-null and valid. |
| pack-priv static void | unregister(FileDescriptor
the FileDescriptor; may be null fdo)Unregister a Cleanable from the FileDescriptor. |
| fd | back to summary |
|---|---|
| private final int fd | |
| fdAccess | back to summary |
|---|---|
| private static final JavaIOFileDescriptorAccess fdAccess | |
| handle | back to summary |
|---|---|
| private final long handle | |
| FileCleanable | back to summary |
|---|---|
| private FileCleanable(FileDescriptor obj, Cleaner cleaner, int fd, long handle) Constructor for a phantom cleanable reference.
| |
| cleanupClose0 | back to summary |
|---|---|
| private static native void cleanupClose0(int fd, long handle) throws IOException | |
| performCleanup | back to summary |
|---|---|
| protected void performCleanup() Implements abstract jdk. Close the native handle or fd.
| |
| register | back to summary |
|---|---|
| pack-priv static void register(FileDescriptor fdo) Register a Cleanable with the FileDescriptor if the FileDescriptor is non-null and valid. Implementation Note An exception (OutOfMemoryException) will leave the FileDescriptor having allocated resources and leak the fd/handle.
| |
| unregister | back to summary |
|---|---|
| pack-priv static void unregister(FileDescriptor fdo) Unregister a Cleanable from the FileDescriptor.
| |