org.deegree_impl.enterprise
Class WTServicePool

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

public class WTServicePool
extends ObjectPool

Pool of WTService-Instances. Singleton.

Version:
$Revision: 1.10 $ $Date: 2004/03/16 15:22:01 $
Author:
Markus Schneider

Field Summary
private static WTServicePool instance
          the only instance of this class
 
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 WTServicePool(java.net.URL configurationURL)
          Private constructor to realize the singleton pattern.
 
Method Summary
 java.lang.Object acuireObject()
          Acquires an instance of WTService from the pool.
 void destroy()
          Clears the pool.
 void fill(int noOfInstances)
          Fills the pool with the given number of instances.
static WTServicePool getInstance(java.net.URL capabilitiesURL)
          Returns the only instance of this class.
 void onObjectKill(java.lang.Object o)
          This method will be called when the passed object is removed from the pool.
 java.lang.String toString()
          Produces a textual representation of this object.
 
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 WTServicePool instance
the only instance of this class

Constructor Detail

WTServicePool

private WTServicePool(java.net.URL configurationURL)
               throws java.lang.Exception
Private constructor to realize the singleton pattern.

Parameters:
configurationURL - URL to the capabilies for the pools objects
Method Detail

getInstance

public static WTServicePool getInstance(java.net.URL capabilitiesURL)
                                 throws java.lang.Exception
Returns the only instance of this class.

Returns:
the only instance of WTServicePool
Throws:
java.lang.Exception

destroy

public void destroy()
Clears the pool. Objects in use while the method has been called won't be put back to the pool if released back through the releaseObject method afterwards.


acuireObject

public java.lang.Object acuireObject()
                              throws java.lang.Exception
Acquires an instance of WTService from the pool.

Returns:
an instance of WTService
Throws:
java.lang.Exception

fill

public void fill(int noOfInstances)
Fills the pool with the given number of instances.

Parameters:
noOfInstances - number of instances to create

onObjectKill

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

Specified by:
onObjectKill in class ObjectPool
Parameters:
o - the object to kill

toString

public java.lang.String toString()
Produces a textual representation of this object.

Overrides:
toString in class ObjectPool
Returns: