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

Type Parameters:
T - The Class used as an id for the recyclable objects. Has to be identical to the Class used by the corresponding Recycler.
All Superinterfaces:
ObjectCreatable<T>
All Known Implementing Classes:
RecyclableImpl, RecyclableObjectWrapper

public interface Recyclable<T>
extends ObjectCreatable<T>

Interface to manage the life cycle of objects in combination with a Recycler. All objects which are to be created by a Recycler must implement this interface.

The key defines how the object is created internally, e.g. which class-instance will be returned.

Author:
rbreuss

Method Summary
 void recycle()
          When the lifecycle of an object is over, this method must be called to return it to the Recycler for later use.
 void setKey(T key)
          Specify key for the object.
 
Methods inherited from interface org.clazzes.util.lifecycle.ObjectCreatable
setObjectFactory
 

Method Detail

setKey

void setKey(T key)
Specify key for the object.

Parameters:
key - The key used to create the object from the factory.

recycle

void recycle()
When the lifecycle of an object is over, this method must be called to return it to the Recycler for later use.



Copyright © 2010. All Rights Reserved.