intarsys runtime library

de.intarsys.tools.resourcetracker
Class PhantomResourceReference

java.lang.Object
  extended by java.lang.ref.Reference<T>
      extended by java.lang.ref.PhantomReference
          extended by de.intarsys.tools.resourcetracker.PhantomResourceReference
All Implemented Interfaces:
IResourceReference

public class PhantomResourceReference
extends PhantomReference
implements IResourceReference

A generic reference to some trackable resource. The resource finalization is managed using a PhantomReference to the container. When the container is garbage collected, the reference is forwarded to the ResourceTracker that created it for disposal.


Constructor Summary
PhantomResourceReference(Object container, Object resource, ResourceTracker tracker)
           
 
Method Summary
 Object getResource()
          The resource tracked.
 
Methods inherited from class java.lang.ref.PhantomReference
get
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, isEnqueued
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhantomResourceReference

public PhantomResourceReference(Object container,
                                Object resource,
                                ResourceTracker tracker)
Method Detail

getResource

public Object getResource()
Description copied from interface: IResourceReference
The resource tracked.

Specified by:
getResource in interface IResourceReference
Returns:
The resource tracked.

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.