org.norther.tammi.core.monitor
Interface Finalizer<T>

Type Parameters:
T - the object type.
All Superinterfaces:
Executable, Runnable, Startable
All Known Implementing Classes:
DefaultFinalizer

public interface Finalizer<T>
extends Executable

An interface to reference queues for referents to be finalized before garbage collected.

Version:
$Id: Finalizer.java,v 1.9 2009/09/28 15:08:42 cvsimp Exp $
Author:
Ilkka Priha

Method Summary
 PhantomReference<T> addPhantomListener(T referent, QueueListener listener)
          Adds a new phantom reference to the reference queue and registers its listener.
 SoftReference<T> addSoftListener(T referent, QueueListener listener)
          Adds a new soft reference to the reference queue and registers its listener.
 WeakReference<T> addWeakListener(T referent, QueueListener listener)
          Adds a new weak reference to the reference queue and registers its listener.
 void removeListener(Reference<?> reference)
          Removes the registered listener of a reference.
 
Methods inherited from interface org.norther.tammi.core.thread.Executable
getExecutorName, setExecutorName
 
Methods inherited from interface org.norther.tammi.core.base.Startable
isStarted, start, stop
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

addPhantomListener

PhantomReference<T> addPhantomListener(T referent,
                                       QueueListener listener)
Adds a new phantom reference to the reference queue and registers its listener.

Parameters:
referent - the referent of the reference.
listener - a listener for the enqueued referent.
Returns:
the new phantom reference.

addWeakListener

WeakReference<T> addWeakListener(T referent,
                                 QueueListener listener)
Adds a new weak reference to the reference queue and registers its listener.

Parameters:
referent - the referent of the reference.
listener - a listener for the enqueued referent.
Returns:
the new weak reference.

addSoftListener

SoftReference<T> addSoftListener(T referent,
                                 QueueListener listener)
Adds a new soft reference to the reference queue and registers its listener.

Parameters:
referent - the referent of the reference.
listener - a listener for the enqueued referent.
Returns:
the new soft reference.

removeListener

void removeListener(Reference<?> reference)
Removes the registered listener of a reference.

Parameters:
reference - the reference.


Copyright © 2004 The Norther Organization. All rights reserved.