org.deegree_impl.enterprise
Class WFSGServicePool

java.lang.Object
  extended byjava.util.TimerTask
      extended byorg.deegree_impl.tools.ObjectPool
          extended byorg.deegree_impl.enterprise.WFSGServicePool
All Implemented Interfaces:
java.lang.Runnable

public class WFSGServicePool
extends ObjectPool

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
private  GazetteerConfiguration conf
           
private static WFSGServicePool instance
           
private  WFSGCapabilities wfsgCapa
           
 
Fields inherited from class org.deegree_impl.tools.ObjectPool
available, existingInstances, in_use, startLifeTime, startUsageTime
 
Fields inherited from class java.util.TimerTask
 
Constructor Summary
private WFSGServicePool(WFSGCapabilities wfsgCapa, GazetteerConfiguration conf)
           
 
Method Summary
 java.lang.Object acuireObject()
           
 void destroy()
           
 void fill(int noOfInstances)
          fill the pool with the submitted number of instances
static WFSGServicePool getInstance(WFSGCapabilities wfsgCapa, GazetteerConfiguration conf)
          realize singelton pattern using double checked locking pattern.
 void onObjectKill(java.lang.Object o)
          this method will be called when the submitted object will be removed from the pool
 java.lang.String toString()
           
 
Methods inherited from class org.deegree_impl.tools.ObjectPool
clear, getInstance, getMaxInstances, getMaxLifeTime, getMaxUsageTime, getUpdateInterval, releaseObject, run, setMaxInstances, setMaxLifeTime, setMaxUsageTime, setUpdateInterval
 
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

instance

private static WFSGServicePool instance

wfsgCapa

private WFSGCapabilities wfsgCapa

conf

private GazetteerConfiguration conf
Constructor Detail

WFSGServicePool

private WFSGServicePool(WFSGCapabilities wfsgCapa,
                        GazetteerConfiguration conf)
Method Detail

getInstance

public static WFSGServicePool getInstance(WFSGCapabilities wfsgCapa,
                                          GazetteerConfiguration conf)
realize singelton pattern using double checked locking pattern.

Returns:
an instance of the object pool. it is gauranteed that there exists only one instance of pool for each submitted class name.

destroy

public void destroy()

acuireObject

public java.lang.Object acuireObject()
                              throws java.lang.Exception
Throws:
java.lang.Exception

fill

public void fill(int noOfInstances)
fill the pool with the submitted number of instances


onObjectKill

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

Specified by:
onObjectKill in class ObjectPool

toString

public java.lang.String toString()
Overrides:
toString in class ObjectPool
Returns: