edu.indiana.dde.mylead.agent.connectionpool
Class MyLeadConnectionPool

java.lang.Object
  extended byjava.lang.Thread
      extended byedu.indiana.dde.mylead.agent.connectionpool.MyLeadConnectionPool
All Implemented Interfaces:
Runnable

public class MyLeadConnectionPool
extends Thread


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MyLeadConnectionPool(int poolSize)
          This allows you to specify how may concurrent connection should be managed by the connection at a given time.
 
Method Summary
 void closeConnections()
           
 MyLeadConnection getMyLeadConnection()
           
 int getNumberOfActiveConnections()
          Returns the current number of active connections.
 int getNumberOfAvailableConnections()
          Returns the number of available connections.
 boolean isConnectionAvailable()
          Check to see if any further connections are available.
static void main(String[] args)
           
 void releaseMyLeadConnection(MyLeadConnection myLeadConnection)
           
 void run()
           
 String toString()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MyLeadConnectionPool

public MyLeadConnectionPool(int poolSize)
                     throws Exception
This allows you to specify how may concurrent connection should be managed by the connection at a given time.

Parameters:
poolSize - The maximum number of active concurrent connections at any given time.
Method Detail

getMyLeadConnection

public MyLeadConnection getMyLeadConnection()

releaseMyLeadConnection

public void releaseMyLeadConnection(MyLeadConnection myLeadConnection)

getNumberOfActiveConnections

public int getNumberOfActiveConnections()
Returns the current number of active connections.

Returns:

getNumberOfAvailableConnections

public int getNumberOfAvailableConnections()
Returns the number of available connections. This is poolSize - numOfActiveConnections.

Returns:

isConnectionAvailable

public boolean isConnectionAvailable()
Check to see if any further connections are available.

Returns:

closeConnections

public void closeConnections()
                      throws Exception
Throws:
Exception

toString

public String toString()

run

public void run()

main

public static void main(String[] args)