Top Description Methods
io.netty5.buffer

public Interface Owned<T>

Annotations
@SuppressWarnings:InterfaceMayBeAnnotatedFunctional
Type Parameters
<T>
The concrete type of Resource that is owned.
Imports
io.netty5.util.Resource, .Send

This interface encapsulates the ownership of a Resource, and exposes a method that may be used to transfer this ownership to the specified recipient thread.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

A new resource instance that is exactly the same as this resource.
transferOwnership
(Drop<T>
The drop object that knows how to dispose of the state represented by this Resource.
drop
)

Transfer the ownership of the resource, to the calling thread.

Method Detail

transferOwnershipback to summary
public T transferOwnership(Drop<T> drop)

Transfer the ownership of the resource, to the calling thread. The resource instance is invalidated but without disposing of its internal state. Then a new resource instance with the given owner is produced in its stead.

This method is called by Send implementations. These implementations will ensure that the transfer of ownership (the calling of this method) happens-before the new owner begins accessing the new object. This ensures that the new resource instance is safely published to the new owners.

Parameters
drop:Drop<T>

The drop object that knows how to dispose of the state represented by this Resource.

Returns:T

A new resource instance that is exactly the same as this resource.