An interface implemented by objects which can be fully recycled.
Recycling involves a component being cleansed of all its state.
Recycling objects can be useful to speed up performance by avoiding the
'new' operator. Recycling of objects is often done when pooling them, and
using the
org.jicarilla.lang.RecyclingObjectFactoryRecyclingObjectFactory class with commons-pool
is a good way to make that as easy as possible.
However, even when you are not using pooling, the recycle()
method may be of use. For example, in conjuction with the
ReadonlyEnabled ReadonlyEnabled interface ... you could use
makeReadonly() to lock an immutable object, then at some later
point recycle() that object, re-initializing it for a new
task.
author: Leo Simons version: $Id: Recyclable.java,v 1.1 2004/03/23 13:37:56 lsimons Exp $ |