001/*
002 * (c) 2005, 2009, 2010 ThoughtWorks Ltd
003 * All rights reserved.
004 *
005 * The software in this package is published under the terms of the BSD
006 * style license a copy of which has been included with this distribution in
007 * the LICENSE.txt file.
008 * 
009 * Created on 02-Aug-2005
010 */
011package com.thoughtworks.proxy.kit;
012
013/**
014 * Interface for a resetter component. This will automatically reset the state of the pooled element, when it is
015 * returned to the pool.
016 *
017 * @author Jörg Schaible
018 * @since 0.2
019 */
020public interface Resetter<T> {
021    /**
022     * Reset the pooled object. The implementation may do anything to reset the state of the pooled element. If the
023     * element is definitely exhausted, a return value of <code>false</code> prevents the element from returning into
024     * the pool and the instance is garbage collected.
025     *
026     * @param object the object to reset
027     * @return <code>true</code> if the element can be used for further tasks.
028     * @since 0.2
029     */
030    boolean reset(T object);
031}