wt.pom
Class POMHandler

java.lang.Object
  extended bywt.pom.POMHandler
All Implemented Interfaces:
POMHandlerIfc, Runnable

public class POMHandler
extends Object
implements POMHandlerIfc, Runnable

An adapter to handle dependencies between the wt.method and wt.pom packages which are potentially loaded by different class loaders.


Field Summary
private  WTConnection[] availableConnections
           
private  PersistentObjectManager pom
           
private static int SYNCH_VERBOSE_THRESHOLD
           
private  int totalConnections
           
 
Fields inherited from interface wt.method.POMHandlerIfc
versionID
 
Constructor Summary
POMHandler()
           
 
Method Summary
 void freeConnection(Object connection)
          Free a datastore connection to be available for reuse.
 int getAvailableConnections()
          Get total number of available connections.
 Object getConnection()
          Get an available connection to a datastore.
 Object getPom()
          Get the POM associated with this handler.
 int getTotalConnections()
          Get total number of open connections.
private  int idleMonitor()
           
private  int memoryMonitor()
           
private  void report()
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pom

private PersistentObjectManager pom

totalConnections

private int totalConnections

availableConnections

private WTConnection[] availableConnections

SYNCH_VERBOSE_THRESHOLD

private static int SYNCH_VERBOSE_THRESHOLD
Constructor Detail

POMHandler

public POMHandler()
Method Detail

getPom

public Object getPom()
              throws POMInitException
Get the POM associated with this handler.

Specified by:
getPom in interface POMHandlerIfc
Returns:
the new POM instance.
Throws:
Exception - Occurs if the handler cannot construct a persistent object manager.
POMInitException

getConnection

public Object getConnection()
                     throws PersistenceException
Get an available connection to a datastore. If there are no available connections, this method may create a new connection or block waiting for an existing connection to become available.

Specified by:
getConnection in interface POMHandlerIfc
Returns:
the datastore connection
Throws:
PersistenceException - Occurs if the persistent object manager cannot connect to a datastore.

freeConnection

public void freeConnection(Object connection)
Free a datastore connection to be available for reuse.

Specified by:
freeConnection in interface POMHandlerIfc
Parameters:
connection - the datastore connection

getTotalConnections

public int getTotalConnections()
Get total number of open connections.

Specified by:
getTotalConnections in interface POMHandlerIfc
Returns:
the number of open connections

getAvailableConnections

public int getAvailableConnections()
Get total number of available connections.

Returns:
the number of available connections

run

public void run()
Specified by:
run in interface Runnable

report

private void report()

idleMonitor

private int idleMonitor()

memoryMonitor

private int memoryMonitor()