-
- Type Parameters:
T
- The type of resource that can be dropped.
- All Known Implementing Classes:
ArcDrop
,CleanerDrop
public interface Drop<T>
An interface used byResource
instances 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 void
attach(T obj)
Called when the resource changes owner.void
drop(T obj)
Dispose of the resources in the givenResource
instance.Drop<T>
fork()
Branch the responsibility of dropping a resource.
-
-
-
Method Detail
-
drop
void drop(T obj)
Dispose of the resources in the givenResource
instance.- Parameters:
obj
- TheResource
instance 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.
-
-