org.clazzes.util.lifecycle
Interface Recycler<T>

All Superinterfaces:
ObjectFactory<T>
All Known Implementing Classes:
AbstractRecyclerImpl, ReflectionRecycler

public interface Recycler<T>
extends ObjectFactory<T>

A recycler works as a specialized factory to deliver new object instances of type Recyclable.

When a recyclable objects isn't used anymore, its Recyclable.recycle() method could be called. The object is then pushed back to the recycler.

Author:
rbreuss

Method Summary
 void pushBack(T key, ObjectCreatable<T> object)
          Objects implementing the Recyclable interface must call this method in their Recyclable.recycle() method with themselves and their key as arguments, to return themselves to the Recycler.
 
Methods inherited from interface org.clazzes.util.lifecycle.ObjectFactory
get
 

Method Detail

pushBack

void pushBack(T key,
              ObjectCreatable<T> object)
Objects implementing the Recyclable interface must call this method in their Recyclable.recycle() method with themselves and their key as arguments, to return themselves to the Recycler.

Parameters:
key - the key by which the Recyclable should be identified to the Recycler
object - the object which is to be recycled.


Copyright © 2010. All Rights Reserved.