protected abstract static class NativeObject.Handle extends Object
| Constructor and Description |
|---|
Handle(org.freedesktop.gstreamer.lowlevel.GPointer ptr,
boolean ownsReference)
Construct a Handle for the supplied native reference.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disown()
Disown the native reference.
|
void |
dispose()
Dispose the handle, and dispose the native reference if owned by this
handle.
|
protected abstract void |
disposeNativeHandle(org.freedesktop.gstreamer.lowlevel.GPointer ptr)
Subclasses should override this method to dispose of the native
reference (free, unref, etc.).
|
protected org.freedesktop.gstreamer.lowlevel.GPointer |
getPointer()
Get the native pointer, or null.
|
void |
invalidate()
Invalidate the handle.
|
boolean |
isCacheable()
Control whether a WeakReference to the NativeObject wrapping this
Handle should be created and cached.
|
protected boolean |
ownsReference()
Test whether this Handle owns the underlying native reference -
should dispose the native reference on
dispose(). |
public Handle(org.freedesktop.gstreamer.lowlevel.GPointer ptr,
boolean ownsReference)
ptr - native referenceownsReference - whether the Handle owns the native reference and
should dispose it when itself disposed.public void disown()
ownsReference() will return false.public void invalidate()
getPointer() will return null, ownsReference() will return
false, and any NativeObject weak reference cached for this
pointer will be removed. Unlike calling dispose() the
native handle will not be disposed - disposeNativeHandle(org.freedesktop.gstreamer.lowlevel.GPointer) will not be called.public void dispose()
getPointer() will return null, ownsReference() will return
false, and any NativeObject weak reference cached for this
pointer will be removed.public boolean isCacheable()
The default implementation always returns true. Subclasses
may override this behaviour if required.
protected abstract void disposeNativeHandle(org.freedesktop.gstreamer.lowlevel.GPointer ptr)
getPointer() will return null by the time this
method is called.ptr - native referenceprotected org.freedesktop.gstreamer.lowlevel.GPointer getPointer()
protected boolean ownsReference()
dispose().Copyright © 2021 gstreamer-java. All rights reserved.