de.intarsys.tools.resourcetracker
Class WeakResourceReference
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference
de.intarsys.tools.resourcetracker.WeakResourceReference
- All Implemented Interfaces:
- IResourceReference
public class WeakResourceReference
- extends WeakReference
- implements IResourceReference
A generic reference to some trackable resource. The resource finalization is
managed using a WeakReference to the container. When the container is
garbage collected, the reference is forwarded to the ResourceTracker
that created it for disposal.
WeakResourceReference
public WeakResourceReference(Object container,
Object resource,
ResourceTracker tracker)
dispose
public void dispose()
- Specified by:
dispose in interface IResourceReference
getResource
public Object getResource()
- Description copied from interface:
IResourceReference
- The resource tracked.
- Specified by:
getResource in interface IResourceReference
- Returns:
- The resource tracked.
Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.