org.deegree_impl.tools
Class ObjectPool

java.lang.Object
  extended byjava.util.TimerTask
      extended byorg.deegree_impl.tools.ObjectPool
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
DBPool, WCASServicePool, WCServicePool, WFSGServicePool, WFSServicePool, WMServicePool, WTServicePool

public abstract class ObjectPool
extends java.util.TimerTask

class to manage the object pool. this is part of the combination of the object pool pattern an the singelton pattern.

----------------------------------------------------------

Version:
07.02.2001

Author:
Andreas Poth

Field Summary
protected  java.util.List available
           
protected  int existingInstances
           
protected  java.util.List in_use
           
private  int maxInstances
           
private  int maxLifeTime
           
private  int maxUsageTime
           
protected  java.util.Map startLifeTime
           
protected  java.util.Map startUsageTime
           
private  int updateInterval
           
 
Fields inherited from class java.util.TimerTask
 
Constructor Summary
protected ObjectPool()
          Creates a new ObjectPool object.
 
Method Summary
private  void cleaner()
           
 void clear()
          clears the complete pool. objects in used while the clear() method has been called won't be put back to the pool if released back through the releaseObject method.
static ObjectPool getInstance()
          dummy
 int getMaxInstances()
           
 int getMaxLifeTime()
           
 int getMaxUsageTime()
           
 int getUpdateInterval()
           
abstract  void onObjectKill(java.lang.Object o)
          this method will be called when the submitted object will be removed from the pool
 void releaseObject(java.lang.Object object)
          release an object back to the pool so it is available from other requests.
 void run()
           
 void setMaxInstances(int maxInstances)
           
 void setMaxLifeTime(int maxLifeTime)
           
 void setMaxUsageTime(int maxUsageTime)
           
 void setUpdateInterval(int updateInterval)
           
 java.lang.String toString()
           
private  void usage()
           
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

available

protected java.util.List available

in_use

protected java.util.List in_use

startLifeTime

protected java.util.Map startLifeTime

startUsageTime

protected java.util.Map startUsageTime

existingInstances

protected int existingInstances

maxInstances

private int maxInstances

maxLifeTime

private int maxLifeTime

maxUsageTime

private int maxUsageTime

updateInterval

private int updateInterval
Constructor Detail

ObjectPool

protected ObjectPool()
Creates a new ObjectPool object.

Method Detail

getInstance

public static ObjectPool getInstance()
dummy

Returns:
null

clear

public void clear()
clears the complete pool. objects in used while the clear() method has been called won't be put back to the pool if released back through the releaseObject method.


releaseObject

public void releaseObject(java.lang.Object object)
                   throws java.lang.Exception
release an object back to the pool so it is available from other requests.

Throws:
java.lang.Exception

onObjectKill

public abstract void onObjectKill(java.lang.Object o)
this method will be called when the submitted object will be removed from the pool


getMaxLifeTime

public int getMaxLifeTime()
Returns:

setMaxLifeTime

public void setMaxLifeTime(int maxLifeTime)
Parameters:
maxLifeTime -

getMaxUsageTime

public int getMaxUsageTime()
Returns:

setMaxUsageTime

public void setMaxUsageTime(int maxUsageTime)
Parameters:
maxUsageTime -

getUpdateInterval

public int getUpdateInterval()
Returns:

setUpdateInterval

public void setUpdateInterval(int updateInterval)
Parameters:
updateInterval -

getMaxInstances

public int getMaxInstances()
Returns:

setMaxInstances

public void setMaxInstances(int maxInstances)
Parameters:
maxInstances -

toString

public java.lang.String toString()
Returns:

run

public void run()

cleaner

private void cleaner()

usage

private void usage()