org.norther.tammi.core.monitor
Class DefaultFinalizer<T>

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.thread.DefaultExecutable
          extended by org.norther.tammi.core.monitor.DefaultFinalizer<T>
Type Parameters:
T - the object type.
All Implemented Interfaces:
Serializable, Runnable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate, Startable, Finalizer<T>, Executable

public class DefaultFinalizer<T>
extends DefaultExecutable
implements Finalizer<T>

A default implementation of Finalizer.

Version:
$Id: DefaultFinalizer.java,v 1.6 2009/09/28 15:08:42 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Constructor Summary
DefaultFinalizer()
          Constructs a new finalizer.
 
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.
 void run()
           
 
Methods inherited from class org.norther.tammi.core.thread.DefaultExecutable
getExecutor, getExecutorName, isStarted, postmanaged, setExecutorName, start, stop, unmanaged
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 

Constructor Detail

DefaultFinalizer

public DefaultFinalizer()
Constructs a new finalizer.

Method Detail

addPhantomListener

public PhantomReference<T> addPhantomListener(T referent,
                                              QueueListener listener)
Description copied from interface: Finalizer
Adds a new phantom reference to the reference queue and registers its listener.

Specified by:
addPhantomListener in interface Finalizer<T>
Parameters:
referent - the referent of the reference.
listener - a listener for the enqueued referent.
Returns:
the new phantom reference.

addWeakListener

public WeakReference<T> addWeakListener(T referent,
                                        QueueListener listener)
Description copied from interface: Finalizer
Adds a new weak reference to the reference queue and registers its listener.

Specified by:
addWeakListener in interface Finalizer<T>
Parameters:
referent - the referent of the reference.
listener - a listener for the enqueued referent.
Returns:
the new weak reference.

addSoftListener

public SoftReference<T> addSoftListener(T referent,
                                        QueueListener listener)
Description copied from interface: Finalizer
Adds a new soft reference to the reference queue and registers its listener.

Specified by:
addSoftListener in interface Finalizer<T>
Parameters:
referent - the referent of the reference.
listener - a listener for the enqueued referent.
Returns:
the new soft reference.

removeListener

public void removeListener(Reference<?> reference)
Description copied from interface: Finalizer
Removes the registered listener of a reference.

Specified by:
removeListener in interface Finalizer<T>
Parameters:
reference - the reference.

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class DefaultExecutable


Copyright © 2004 The Norther Organization. All rights reserved.