ObjectHandles
public interface ObjectHandlesManages a set of ObjectHandles. The handles returned by create are bound to the creating handle set, i.e., the handle can only be accessed and destroyed using the exact same handle set used for creation.
Methods5
static ObjectHandles getGlobal()
getGlobal
staticsince 19.0static ObjectHandles getGlobal()A set of handles that is kept alive globally.
Returns
ObjectHandles- No description.
static ObjectHandles create()
create
staticsince 19.0static ObjectHandles create()Creates a new set of handles. Objects are kept alive until the returned ObjectHandles instance gets unreachable.
Returns
ObjectHandles- No description.
ObjectHandle create(Object)
create
since 19.0ObjectHandle create(Object object)Creates a handle to the specified object. The object is kept alive by the garbage collector at least until destroy is called for the returned handle. The object can be null.
Parameters
objectObject- No description.
Returns
ObjectHandle- No description.
T get(ObjectHandle)
get
since 19.0< T> T get(ObjectHandle handle)Extracts the object from a given handle.
Parameters
handleObjectHandle- No description.
Returns
T- No description.
void destroy(ObjectHandle)
destroy
since 19.0void destroy(ObjectHandle handle)Destroys the given handle. After calling this method, the handle must not be used anymore.
Parameters
handleObjectHandle- No description.