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 by Resource instances to implement their resource disposal mechanics. The drop(Object) method will be called by the resource when they are closed.
    • Method Detail

      • drop

        void drop​(T obj)
        Dispose of the resources in the given Resource instance.
        Parameters:
        obj - The Resource 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.
      • attach

        void attach​(T obj)
        Called when the resource changes owner.
        Parameters:
        obj - The new Resource instance with the new owner.