Package io.netty5.buffer.api
Interface Drop<T>
-
- Type Parameters:
T- The type of resource that can be dropped.
- All Known Implementing Classes:
ArcDrop,CleanerDrop
public interface Drop<T>An interface used byResourceinstances to implement their resource disposal mechanics. Thedrop(Object)method will be called by the resource when they are closed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidattach(T obj)Called when the resource changes owner.voiddrop(T obj)Dispose of the resources in the givenResourceinstance.Drop<T>fork()Branch the responsibility of dropping a resource.
-
-
-
Method Detail
-
drop
void drop(T obj)
Dispose of the resources in the givenResourceinstance.- Parameters:
obj- TheResourceinstance being dropped.
-
fork
Drop<T> fork()
Branch the responsibility of dropping a resource. This drop instance will remain associated with its current resource, while the returned drop instance must be attached to its new resource.- Returns:
- A drop instance, similar to this one, but for the purpose of being associated with a different but related resource.
-
-