edu.ucsb.adl.middleware
Class ReferenceCountedDelayedDestroy

java.lang.Object
  |
  +--edu.ucsb.adl.middleware.ReferenceCountedDelayedDestroy

public class ReferenceCountedDelayedDestroy
extends java.lang.Object

A base class that supports reference counting and delayed destruction. Specifically, this class provides a destroy method that waits until the reference count becomes zero before returning. Subclasses of this class that need to perform class-specific destruction actions should do so by overriding the destroy method as follows:

public void destroy () {
    super.destroy();
    ...
}

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/ReferenceCountedDelayedDestroy.java,v 1.1 2001/08/11 04:23:49 gjanee Exp $

$Log: ReferenceCountedDelayedDestroy.java,v $ Revision 1.1 2001/08/11 04:23:49 gjanee Initial revision

Author:
Greg Janée
Alexandria Digital Library

Constructor Summary
ReferenceCountedDelayedDestroy()
          Initializes the reference count to zero.
 
Method Summary
 void destroy()
          Waits until the reference count becomes zero and then marks the object as being destroyed.
 void reference()
          Increments the reference count.
 void release()
          Decrements the reference count.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceCountedDelayedDestroy

public ReferenceCountedDelayedDestroy()
Initializes the reference count to zero.

Method Detail

reference

public void reference()
Increments the reference count.


release

public void release()
Decrements the reference count.


destroy

public void destroy()
Waits until the reference count becomes zero and then marks the object as being destroyed.