public abstract class AbstractNativeProxy
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected NativeHandle |
nativeHandle
A handle to the native object.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractNativeProxy(NativeHandle nativeHandle) |
Modifier and Type | Method and Description |
---|---|
protected long |
getNativeHandle()
Returns a handle to the native object if it may be safely used to access the native object.
|
protected boolean |
isValidHandle()
Returns true if this proxy has a valid native handle.
|
protected final NativeHandle nativeHandle
protected AbstractNativeProxy(NativeHandle nativeHandle)
protected long getNativeHandle()
nativeHandle.get()
.
The returned value shall only be passed as an argument to native methods.
Warning: do not cache the return value, as you won't be able to catch use-after-free.
java.lang.IllegalStateException
- if the native handle is invalid (closed or nullptr)protected final boolean isValidHandle()
Copyright © 2018 Exonum. All rights reserved.