jason.service.pool
Class PassivePool

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--java.util.Stack
                          |
                          +--jason.service.pool.PassivePool
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, PassivePoolInt, java.util.RandomAccess, java.io.Serializable

public class PassivePool
extends java.util.Stack
implements PassivePoolInt

This class represents the passive pool of threads which are waiting to service clients. This class is implemented over a java.util.Stack and is more of a data oriented class.
Author - Sanjay"Ironluca"Debnath Ironluca@yahoo.com
Last Modified - 9/03/2001

See Also:
Serialized Form

Field Summary
protected  int presentSize
          Present size of the PassivePool.
protected  java.lang.Class threadClass
          The class for which the Passive Pool is being maintained.
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PassivePool(java.lang.Class threadClass)
          The only visible constructor for the class.
 
Method Summary
 int getPresentSize()
          Returns the presentSize of the PassivePool.
 java.lang.Class getThreadClass()
          This method returns the class for which the pool is being maintained.
 java.lang.Object pop()
          This method is overridden to decrement the presentSize when an object is popped.
 java.lang.Object push(java.lang.Object threadCapsuleObj)
          This method is overridden to increment the presentSize when an object is pushed.
 void setSize(int newSize)
          This method of Stack class is being overridden - the functionality remains the same as in Vector this method reduces the size of the passivePool.
 
Methods inherited from class java.util.Stack
empty, peek, search
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

presentSize

protected int presentSize
Present size of the PassivePool.


threadClass

protected java.lang.Class threadClass
The class for which the Passive Pool is being maintained.

Constructor Detail

PassivePool

public PassivePool(java.lang.Class threadClass)
The only visible constructor for the class. It initializes some internal state.

Parameters:
threadClass - The Class for which the passive pool is maintained.
Method Detail

getPresentSize

public int getPresentSize()
Returns the presentSize of the PassivePool.

Specified by:
getPresentSize in interface PassivePoolInt

pop

public java.lang.Object pop()
This method is overridden to decrement the presentSize when an object is popped.

Specified by:
pop in interface PassivePoolInt
Overrides:
pop in class java.util.Stack

push

public java.lang.Object push(java.lang.Object threadCapsuleObj)
This method is overridden to increment the presentSize when an object is pushed.

Specified by:
push in interface PassivePoolInt
Overrides:
push in class java.util.Stack

getThreadClass

public java.lang.Class getThreadClass()
This method returns the class for which the pool is being maintained.

Specified by:
getThreadClass in interface PassivePoolInt
Returns:
java.lang.Class - The class for which the pool is being maintained.

setSize

public void setSize(int newSize)
This method of Stack class is being overridden - the functionality remains the same as in Vector this method reduces the size of the passivePool.

Specified by:
setSize in interface PassivePoolInt
Overrides:
setSize in class java.util.Vector