1 package org.apache.turbine.util.pool;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 /***
20 * An interface for objects that can be pooled and
21 * recycled several times by different clients.
22 *
23 * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
24 * @version $Id: Recyclable.java 264148 2005-08-29 14:21:04Z henning $
25 */
26 public interface Recyclable
27 {
28 /***
29 * Recycles the object for a new client. Recycle methods with
30 * parameters must be added to implementing object and they will be
31 * automatically called by pool implementations when the object is
32 * taken from the pool for a new client. The parameters must
33 * correspond to the parameters of the constructors of the object.
34 * For new objects, constructors can call their corresponding recycle
35 * methods whenever applicable.
36 * The recycle methods must call their super.
37 */
38 void recycle();
39
40 /***
41 * Disposes the object after use. The method is called
42 * when the object is returned to its pool.
43 * The dispose method must call its super.
44 */
45 void dispose();
46
47 /***
48 * Checks whether the recyclable has been disposed.
49 * @return true, if the recyclable is disposed.
50 */
51 boolean isDisposed();
52 }