com.waveset.adapter
Class HostConnPool

java.lang.Object
  extended bycom.waveset.adapter.HostConnPool

public class HostConnPool
extends java.lang.Object

Pools HostAccess connections to reduce the number of host authentications and avoid simultaneous logins of the same AccountIterator. Note: when we go to a multiple server model, this pool will not prevent 2 different Lighthouse servers from logging into the same host with the same user ID at the same time.


Field Summary
protected static Trace _trace
           
static java.lang.String code_id
           
protected static int DEFAULT_MAX_CONNECTIONS
           
 
Method Summary
static HostAccess getAffinityConnection(HostAccessLogin haLogin)
           
static HostAccess getAffinityConnection(HostAccessLogin haLogin, java.lang.String poolKey, int maxConnections)
           
static java.util.List getAllPoolStatistics()
          Return a list of lists of elements which are all of the contents of all of the pools.
static HostAccess getConnection(HostAccessLogin haLogin)
          Deprecated. Use getAffinityConnection instead
protected  HostAccess getFree(java.lang.String key)
           
 java.lang.String getKey()
           
 java.lang.String getPoolStatistics()
          Get useful statistics for the whole pool.
protected  boolean putFree(HostAccess ha)
          Deprecated. switch to affinity connections and use putAffinityFree instead
protected  void putInUse(HostAccess ha)
           
 void reapConnections()
           
static void releaseConnection(HostAccess hostAccess)
           
 void setKey(java.lang.String key)
           
 void setMaxConnections(int max)
           
 void shutdown()
           
static void shutdownAll()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

_trace

protected static final Trace _trace

DEFAULT_MAX_CONNECTIONS

protected static final int DEFAULT_MAX_CONNECTIONS
See Also:
Constant Field Values
Method Detail

setMaxConnections

public void setMaxConnections(int max)

getKey

public java.lang.String getKey()

setKey

public void setKey(java.lang.String key)

reapConnections

public void reapConnections()

getConnection

public static HostAccess getConnection(HostAccessLogin haLogin)
                                throws java.lang.Exception
Deprecated. Use getAffinityConnection instead

Throws:
java.lang.Exception

getAffinityConnection

public static HostAccess getAffinityConnection(HostAccessLogin haLogin)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

getAffinityConnection

public static HostAccess getAffinityConnection(HostAccessLogin haLogin,
                                               java.lang.String poolKey,
                                               int maxConnections)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

getAllPoolStatistics

public static java.util.List getAllPoolStatistics()
Return a list of lists of elements which are all of the contents of all of the pools.


getPoolStatistics

public java.lang.String getPoolStatistics()
Get useful statistics for the whole pool. Assumes a synchronized(_pools) context.


releaseConnection

public static void releaseConnection(HostAccess hostAccess)

getFree

protected HostAccess getFree(java.lang.String key)

putFree

protected boolean putFree(HostAccess ha)
Deprecated. switch to affinity connections and use putAffinityFree instead

Returns false if there are too many free connections on the queue already. The connection will not be put on the list, and the connection should be closed by the caller.


putInUse

protected void putInUse(HostAccess ha)

shutdownAll

public static void shutdownAll()

shutdown

public void shutdown()