org.deegree_impl.enterprise
Class WMServicePool

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

public class WMServicePool
extends ObjectPool

Pool of WMService-Instances. Singleton.

Version:
$Revision: 1.9 $ $Date: 2004/03/01 07:45:47 $
Author:
Markus Schneider, Andreas Poth

Field Summary
private  WMSCapabilities capabilities
          all WMServices of this pool conform to these capabilities
private static WMServicePool 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 WMServicePool(WMSCapabilities capabilities)
          Private constructor to realize the singleton pattern.
 
Method Summary
 java.lang.Object acuireObject()
          Acquires an instance of WMService from the pool.
 void destroy()
          Clears the pool.
 void fill(int noOfInstances)
          Fills the pool with the given number of instances.
static WMServicePool getInstance(WMSCapabilities capabilities)
          Returns the only instance of this class.
 void onObjectKill(java.lang.Object o)
          This method will be called when the submitted 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 WMServicePool instance
the only instance of this class


capabilities

private WMSCapabilities capabilities
all WMServices of this pool conform to these capabilities

Constructor Detail

WMServicePool

private WMServicePool(WMSCapabilities capabilities)
               throws java.lang.Exception
Private constructor to realize the singleton pattern.

Parameters:
capabilities - the capabilities the pool objects must conform to
Method Detail

getInstance

public static WMServicePool getInstance(WMSCapabilities capabilities)
                                 throws java.lang.Exception
Returns the only instance of this class.

Returns:
the only instance of WMServicePool
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 WMService from the pool.

Returns:
an instance of WMService
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 submitted object is removed from the pool. FIXME!!!

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: