net.spy.pool
Class PoolContainer

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.pool.PoolContainer

public class PoolContainer
extends SpyObject

PoolContainer is the storage for a given pool.


Constructor Summary
PoolContainer(java.lang.String nm, PoolFiller pf)
          Create a new PoolContainer for a pool with a given name, and filler.
PoolContainer(java.lang.String nm, PoolFiller pf, SpyConfig cnf)
          Create a new PoolContainer for a pool with a given name, and filler.
 
Method Summary
 int availableObjects()
          Find out how many objects are available in this pool.
 java.lang.String getName()
          Get the name of the pool.
 PooledObject getObject()
          Get an object from the pool.
 java.lang.String toString()
          debugging tool, dump out the current state of the pool
 int totalObjects()
          Find out how many objects are in this pool.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PoolContainer

public PoolContainer(java.lang.String nm,
                     PoolFiller pf,
                     SpyConfig cnf)
              throws PoolException
Create a new PoolContainer for a pool with a given name, and filler. The following optional config parameters will be used:

Parameters:
nm - name of the pool
pf - the PoolFiller to use
cnf - a SpyConfig object that should describe the pool parameters.
Throws:
PoolException - when something bad happens

PoolContainer

public PoolContainer(java.lang.String nm,
                     PoolFiller pf)
              throws PoolException
Create a new PoolContainer for a pool with a given name, and filler. The following optional config parameters will be used:

Parameters:
name - name of the pool
pf - the PoolFiller to use
Throws:
PoolException - when something bad happens
Method Detail

getName

public java.lang.String getName()
Get the name of the pool.


getObject

public PooledObject getObject()
                       throws PoolException
Get an object from the pool. It could take up to about three seconds to get an object from the pool.

Throws:
PoolException - when something bad happens

toString

public java.lang.String toString()
debugging tool, dump out the current state of the pool

Overrides:
toString in class java.lang.Object

availableObjects

public int availableObjects()
Find out how many objects are available in this pool.

Returns:
the number of available (not checked out) objects.

totalObjects

public int totalObjects()
Find out how many objects are in this pool. This will be the sum of the available and unavailable objects.



Copyright © 1995-2005 SPY Internetworking. All Rights Reserved.