IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.services.jdbcservicesinfra
Class OrphanTimeoutHandling

java.lang.Object
  extended bycom.ibm.btt.services.jdbcservicesinfra.OrphanTimeoutHandling
All Implemented Interfaces:
java.lang.Runnable

public class OrphanTimeoutHandling
extends java.lang.Object
implements java.lang.Runnable

OrphanTimeoutHandling is necessary to monitor each connection about the idle time, if there is no any operation in regular time, the connection will be disconnect.


Field Summary
static java.util.Hashtable PoolOrphan
           
static boolean threadStart
           
 
Constructor Summary
OrphanTimeoutHandling()
           
 
Method Summary
static void addItem(java.lang.String poolid, java.lang.Object obj)
          add item to Hashtable that put the idle counter for each pool instance.
 long getOperationTime(java.lang.String poolid)
          get database operation time.
 long getOrphanTimeout()
          return the timeout.
 long getReapTime()
          return the interval.
static void removeItem(java.lang.String poolid)
          remove item from Hashtable that put the idle counter for each pool instance.
 void resetPoolOrphan(java.util.Hashtable NewPool)
          refresh the Hashtable PoolOrphan.
 void run()
          monitor operation in thread.
 void setOrphanTimeout(java.lang.Long orphantime)
          set the timeout.
 void setReapTime(java.lang.Long reap)
          set the interval to check if idle time is greater than timeout.
 void start()
          start monitor thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PoolOrphan

public static java.util.Hashtable PoolOrphan

threadStart

public static boolean threadStart
Constructor Detail

OrphanTimeoutHandling

public OrphanTimeoutHandling()
Method Detail

setOrphanTimeout

public void setOrphanTimeout(java.lang.Long orphantime)
set the timeout.

Parameters:
orphantime - java.lang.Long

getOrphanTimeout

public long getOrphanTimeout()
return the timeout.

Returns:
java.lang.Long

setReapTime

public void setReapTime(java.lang.Long reap)
set the interval to check if idle time is greater than timeout.

Parameters:
reap - java.lang.Long. Interval to start the idle instance checking routine

getReapTime

public long getReapTime()
return the interval.

Returns:
java.lang.Long

getOperationTime

public long getOperationTime(java.lang.String poolid)
get database operation time.

Parameters:
poolid - java.lang.String
Returns:
java.lang.Long

addItem

public static void addItem(java.lang.String poolid,
                           java.lang.Object obj)
add item to Hashtable that put the idle counter for each pool instance.

Parameters:
poolid - java.lang.String
obj - java.lang.Object

removeItem

public static void removeItem(java.lang.String poolid)
remove item from Hashtable that put the idle counter for each pool instance.

Parameters:
poolid - String. Pool instance id.

resetPoolOrphan

public void resetPoolOrphan(java.util.Hashtable NewPool)
refresh the Hashtable PoolOrphan.

Parameters:
NewPool - java.util.Hashtable

start

public void start()
start monitor thread.


run

public void run()
monitor operation in thread.

Specified by:
run in interface java.lang.Runnable

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005