- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.PhantomReference<net.imagej.ImgPlus>
-
- io.scif.img.ImgPlusCtxCleaningProvider.ImgPlusCtxCleaner
-
- All Implemented Interfaces:
CleaningRef
- Enclosing class:
- ImgPlusCtxCleaningProvider
public static class ImgPlusCtxCleaningProvider.ImgPlusCtxCleaner extends PhantomReference<net.imagej.ImgPlus> implements CleaningRef
PhantomReferenceimplementation used to dispose aContextwhen allImgPlusreferences have been garbage collected. Create this reference as new ImgPlus instances are generated with an anonymous Context. This will ensure that when the ImgPlus instances go out of scope, the Context is shut down properly.- Author:
- Mark Hiner
-
-
Constructor Summary
Constructors Constructor Description ImgPlusCtxCleaner(Object imgPlus, ReferenceQueue queue, Object... params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Hook for cleaning up resources when this reference is removed from aReferenceQueue.-
Methods inherited from class java.lang.ref.PhantomReference
get
-
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence
-
-
-
-
Constructor Detail
-
ImgPlusCtxCleaner
public ImgPlusCtxCleaner(Object imgPlus, ReferenceQueue queue, Object... params)
-
-
Method Detail
-
cleanup
public void cleanup()
Description copied from interface:CleaningRefHook for cleaning up resources when this reference is removed from aReferenceQueue.- Specified by:
cleanupin interfaceCleaningRef
-
-