org.apache.java.recycle.pool
Class WorkerContainer

java.lang.Object
  |
  +--org.apache.java.recycle.pool.WorkerContainer

class WorkerContainer
extends java.lang.Object
implements RecycleBin

This class implements the container that is used to store the recycled threads.

Version:
$Revision: 1.3 $ $Date: 1999/06/24 00:50:53 $

Field Summary
private  int capacity
           
private  RecycleBin container
           
private  java.lang.ThreadGroup group
           
private  int level
           
 
Constructor Summary
protected WorkerContainer(RecycleBin container, java.lang.ThreadGroup group, int capacity)
           
 
Method Summary
 Recyclable getRecyclable()
          This method is called to obtain a recyclable object from this recycle bin.
 int getSize()
          This method returns the actual number of recyclable objects contained in this recycle bin.
 void recycle(Recyclable worker)
          This method is called to recycle a recyclable object into this container.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

container

private RecycleBin container

group

private java.lang.ThreadGroup group

capacity

private int capacity

level

private int level
Constructor Detail

WorkerContainer

protected WorkerContainer(RecycleBin container,
                          java.lang.ThreadGroup group,
                          int capacity)
Method Detail

getRecyclable

public Recyclable getRecyclable()
Description copied from interface: RecycleBin
This method is called to obtain a recyclable object from this recycle bin.
Specified by:
getRecyclable in interface RecycleBin
Tags copied from interface: RecycleBin
Throws:
RecycleBinIsEmpty - when recycle bin is empty.

recycle

public void recycle(Recyclable worker)
Description copied from interface: RecycleBin
This method is called to recycle a recyclable object into this container. The clean() method is guaranteed to be called by the RecycleBin implementation before the object is stored.
Specified by:
recycle in interface RecycleBin
Tags copied from interface: RecycleBin
Throws:
ObjectWasDestroyed - when object is destroied.

getSize

public int getSize()
Description copied from interface: RecycleBin
This method returns the actual number of recyclable objects contained in this recycle bin.
Specified by:
getSize in interface RecycleBin