org.apache.java.recycle
Interface Recyclable

All Known Implementing Classes:
Worker

public abstract interface Recyclable

This interface standardizes the behaviour of a recyclable object. A recyclable object is defined as an object that can be used to encapsulate another object without being altered by its content. Therefore, a recyclable object may be cleaned and reused many times before being destroied. This is helpful in cases where recyclable objects are continously created and destroied, causing a much greater amount of garbage to be collected by the JVM garbage collector. By making it recyclable, it is possible to reduce the GC execution time thus incrementing the overall performance of a process and decrementing the chance of memory overflow. Every implementation must provide their own method to allow this recyclable object to be reused by setting its content.

Version:
$Revision: 1.3 $ $Date: 1999/06/24 00:50:50 $

Method Summary
 void clean()
          This method cleans this object by setting every container reference to null, causing the content to be garbage collected.
 void destroy()
          This method is called to kill this object when not needed.
 

Method Detail

clean

public void clean()
This method cleans this object by setting every container reference to null, causing the content to be garbage collected.

destroy

public void destroy()
This method is called to kill this object when not needed. It should close every resource permanently allocated by this object.