openlsd.web.extension
Class LSDWebClientGetPool

java.lang.Object
  extended by openlsd.web.extension.LSDWebClientGetPool

public class LSDWebClientGetPool
extends java.lang.Object

Cache Pools for LSD Web Client for Get

Author:
Frederic BREGIER LGPL 2007

Field Summary
 java.util.concurrent.ConcurrentHashMap<java.lang.Long,LSDWebPoolConnection> hashMapPoolConnection
          Hash map of all PoolConnection based on IpPort Id
 
Constructor Summary
LSDWebClientGetPool()
          Constructor
 
Method Summary
 int checkNbInPool()
          Returns the number of active sessions in the pool
 void close(LSDWebClientGet session)
          Returns the session in the pool
 void closeAll()
          Close all connections
 int getNbInPool()
          Returns the number of sessions in the pool
 LSDWebClientGet open(LSDDbIpPort ipport)
          Get an existing connection or opening a new one
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hashMapPoolConnection

public java.util.concurrent.ConcurrentHashMap<java.lang.Long,LSDWebPoolConnection> hashMapPoolConnection
Hash map of all PoolConnection based on IpPort Id

Constructor Detail

LSDWebClientGetPool

public LSDWebClientGetPool()
Constructor

Method Detail

open

public LSDWebClientGet open(LSDDbIpPort ipport)
Get an existing connection or opening a new one

Parameters:
ipport -
Returns:
the connection

close

public void close(LSDWebClientGet session)
Returns the session in the pool

Parameters:
session -

getNbInPool

public int getNbInPool()
Returns the number of sessions in the pool

Returns:
the number of sessions

checkNbInPool

public int checkNbInPool()
Returns the number of active sessions in the pool

Returns:
the number of active sessions

closeAll

public void closeAll()
Close all connections