SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

serp.util
Interface Pool

All Superinterfaces:
Collection, Set
All Known Implementing Classes:
AbstractPool

Deprecated. Use the Jakarta project's Commons Pool module.

Unlike most collections, pools do not allow null values.

public interface Pool
extends Set

A pool of resources.

All methods inherited from the Collection refer to the free members of the pool. The takenSet() method can be used to access the taken items. In pools, the Collection.add(java.lang.Object) and related methods are overloaded to either add new pooled items or return taken instances. Whether returning taken instances is required depends on the pool implementation.


Method Summary
 boolean equals(Object obj)
          Deprecated. Pool equality should be implemented to compare the free elements of the pool.
 Object get()
          Deprecated. Return a free pooled instance.
 Object get(Object match)
          Deprecated. Return a free pooled instance that compares equal to the given object using the equals method.
 Object get(Object match, Comparator comp)
          Deprecated. Return a free pooled instance that compares equal to the given object via the given comparator.
 int getAutoReturn()
          Deprecated. Return the maximum number of milliseconds a pooled item can be taken before it is automatically returned to the pool.
 int getMaxPool()
          Deprecated. Return the maximum number of pooled items, including taken instances.
 int getMinPool()
          Deprecated. Return the minimum number of pooled items, including taken instances.
 int getWait()
          Deprecated. Return the maximum number of milliseconds the get() method will wait for a free pool item.
 int hashCode()
          Deprecated. The hash code should be implemented to be consistent with equality.
 Iterator iterator()
          Deprecated. Returns an iterator over the free elements of the pool.
 void setAutoReturn(int millis)
          Deprecated. Return the maximum number of milliseconds a pooled item can be taken before it is automatically returned to the pool.
 void setMaxPool(int max)
          Deprecated. Set the maximum number of pooled items, including taken instances.
 void setMinPool(int min)
          Deprecated. Set the minimum number of pooled items, including taken instances.
 void setWait(int millis)
          Deprecated. Set the maximum number of milliseconds the get() method will wait for a free pool item.
 Set takenSet()
          Deprecated. Return a read-only view of the set of taken instances.
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

getMaxPool

public int getMaxPool()
Deprecated. 
Return the maximum number of pooled items, including taken instances. A value of 0 indicates that there should be no maximum. This property defaults to 0.

setMaxPool

public void setMaxPool(int max)
Deprecated. 
Set the maximum number of pooled items, including taken instances. A value of 0 indicates that there should be no maximum. This property defaults to 0. If it is set to less than the current size of the pool, the free instances will be trimmed to size, and subsequence Collection.add(java.lang.Object) operations will return false until the maximum is met.

getMinPool

public int getMinPool()
Deprecated. 
Return the minimum number of pooled items, including taken instances. This property defaults to 0. If greater than 0, Collection.remove(java.lang.Object) methods may fail if the size would be trimmed to under the minimum value.

setMinPool

public void setMinPool(int min)
Deprecated. 
Set the minimum number of pooled items, including taken instances. This property defaults to 0. If set to greater than 0, Collection.remove(java.lang.Object) operations may fail if the constraint would be violated. However, the Collection.clear() operation will always succeed.

getWait

public int getWait()
Deprecated. 
Return the maximum number of milliseconds the get() method will wait for a free pool item. This property defaults to 0.

setWait

public void setWait(int millis)
Deprecated. 
Set the maximum number of milliseconds the get() method will wait for a free pool item. This property defaults to 0.

getAutoReturn

public int getAutoReturn()
Deprecated. 
Return the maximum number of milliseconds a pooled item can be taken before it is automatically returned to the pool. If this property is set to 0, taken items will never be automatically returned. This property defaults to 0.

setAutoReturn

public void setAutoReturn(int millis)
Deprecated. 
Return the maximum number of milliseconds a pooled item can be taken before it is automatically returned to the pool. If this property is set to 0, taken items will never be automatically returned. This property defaults to 0.

iterator

public Iterator iterator()
Deprecated. 
Returns an iterator over the free elements of the pool. The iterator's Iterator.remove() remove method may throw an IllegalStateException if removing an element would violoate the minimum pool size.
Specified by:
iterator in interface Set

get

public Object get()
Deprecated. 
Return a free pooled instance. This method does change the state of the pool, and thus should be considered a mutator.

get

public Object get(Object match)
Deprecated. 
Return a free pooled instance that compares equal to the given object using the equals method.
See Also:
get()

get

public Object get(Object match,
                  Comparator comp)
Deprecated. 
Return a free pooled instance that compares equal to the given object via the given comparator.
See Also:
get()

takenSet

public Set takenSet()
Deprecated. 
Return a read-only view of the set of taken instances.

equals

public boolean equals(Object obj)
Deprecated. 
Pool equality should be implemented to compare the free elements of the pool.
Specified by:
equals in interface Set
Overrides:
equals in class Object

hashCode

public int hashCode()
Deprecated. 
The hash code should be implemented to be consistent with equality.
Specified by:
hashCode in interface Set
Overrides:
hashCode in class Object

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.