org.objectweb.jonas.resource.pool.lib
Class HArrayPool

java.lang.Object
  |
  +--org.objectweb.jonas.resource.pool.lib.HArrayPool
All Implemented Interfaces:
Pool

public class HArrayPool
extends java.lang.Object
implements Pool

The class HArrayPool implements a Pool as a HashSet of ManagedConnections, managing free/active resources.


Constructor Summary
HArrayPool()
           
 
Method Summary
 PoolMatchFactory getMatchFactory()
          getMatchFactory retrieves the PoolMatchFactory assigned to this Pool.
 int getMaxSize()
          getMaxSize retrieves the maximum size assigned to this Pool.
 int getMinSize()
          getMinSize retrieves the minimum size assigned to this Pool.
 java.lang.Object getResource(java.lang.Object hints)
          getResource is used to allocate a Object from the Pool.
 int getSize()
          getSize retrieves the current size of this Pool.
 long getTimeout()
          getTimeout retrieves the timeout assigned to this Pool.
 void releaseResource(java.lang.Object resource, boolean destroy)
          releaseResource releases a Object in order to allow the Pool to recycle this Object.
 void setInitSize(int initsize)
          setInitSize creates initsize resoures to this Pool.
 void setMatchFactory(PoolMatchFactory pmf)
          setMatchFactory assigns a PoolMatchFactory to this Pool.
 void setMaxSize(int maxsize)
          setMaxSize assigns a maximum size to this Pool.
 void setMinSize(int minsize)
          setMinSize assigns a minimum size to this Pool.
 void setTimeout(long crto)
          setTimeout assigns a timeout to this Pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HArrayPool

public HArrayPool()
Method Detail

getTimeout

public long getTimeout()
Description copied from interface: Pool
getTimeout retrieves the timeout assigned to this Pool.
Specified by:
getTimeout in interface Pool
See Also:
Pool.getTimeout()

getMinSize

public int getMinSize()
Description copied from interface: Pool
getMinSize retrieves the minimum size assigned to this Pool.
Specified by:
getMinSize in interface Pool
See Also:
Pool.getMinSize()

getMatchFactory

public PoolMatchFactory getMatchFactory()
Description copied from interface: Pool
getMatchFactory retrieves the PoolMatchFactory assigned to this Pool.
Specified by:
getMatchFactory in interface Pool
See Also:
Pool.getMatchFactory()

getMaxSize

public int getMaxSize()
Description copied from interface: Pool
getMaxSize retrieves the maximum size assigned to this Pool.
Specified by:
getMaxSize in interface Pool
See Also:
Pool.getMaxSize()

getResource

public java.lang.Object getResource(java.lang.Object hints)
                             throws java.lang.Exception
Description copied from interface: Pool
getResource is used to allocate a Object from the Pool. Some hints are passed in order to specialise the matching or creation of Object.
Specified by:
getResource in interface Pool
See Also:
Pool.getResource(java.lang.Object)

getSize

public int getSize()
Description copied from interface: Pool
getSize retrieves the current size of this Pool.
Specified by:
getSize in interface Pool
Following copied from interface: org.objectweb.jonas.resource.pool.api.Pool
Returns:
The current size of this Pool.

releaseResource

public void releaseResource(java.lang.Object resource,
                            boolean destroy)
                     throws java.lang.Exception
Description copied from interface: Pool
releaseResource releases a Object in order to allow the Pool to recycle this Object.
Specified by:
releaseResource in interface Pool
See Also:
Pool.releaseResource(java.lang.Object, boolean)

setTimeout

public void setTimeout(long crto)
Description copied from interface: Pool
setTimeout assigns a timeout to this Pool.
Specified by:
setTimeout in interface Pool
See Also:
Pool.setTimeout(long)

setMinSize

public void setMinSize(int minsize)
                throws java.lang.Exception
Description copied from interface: Pool
setMinSize assigns a minimum size to this Pool.
Specified by:
setMinSize in interface Pool
See Also:
Pool.setMinSize(int)

setInitSize

public void setInitSize(int initsize)
                 throws java.lang.Exception
Description copied from interface: Pool
setInitSize creates initsize resoures to this Pool.
Specified by:
setInitSize in interface Pool
See Also:
Pool.setMinSize(int)

setMatchFactory

public void setMatchFactory(PoolMatchFactory pmf)
Description copied from interface: Pool
setMatchFactory assigns a PoolMatchFactory to this Pool.
Specified by:
setMatchFactory in interface Pool
See Also:
Pool.setMatchFactory(org.objectweb.jonas.resource.pool.api.PoolMatchFactory)

setMaxSize

public void setMaxSize(int maxsize)
                throws java.lang.Exception
Description copied from interface: Pool
setMaxSize assigns a maximum size to this Pool.
Specified by:
setMaxSize in interface Pool
See Also:
Pool.setMaxSize(int)