com.waveset.adapter
Class AgentConnectionPool

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

public class AgentConnectionPool
extends java.lang.Object


Constructor Summary
AgentConnectionPool(Resource r)
          deprecated.
AgentConnectionPool(Resource r, LighthouseContext ctx)
           
 
Method Summary
 void checkHungConnections()
           
 boolean checkPoolCountValid()
          Test method to check the pool status NOT FOR PUBLIC CONSUMPTION (not synchronized or anything)
 void closeConnections()
           
 RASecureConnection getConnection()
          Return a connected connection.
 java.lang.String getName()
           
 int getPoolFreeCount()
          Test method to check the pool status NOT FOR PUBLIC CONSUMPTION (not synchronized or anything)
 int getPoolInUseCount()
          Test method to check the pool status NOT FOR PUBLIC CONSUMPTION (not synchronized or anything)
 Resource getResource()
          Test method to show the pool name, resource, type, graphically
 boolean matchResource(Resource r)
          If the class, port, and host match, return true.
 void reapConnections()
           
 void returnConnection(RASecureConnection conn, boolean isBogus)
          Return a connection to the pool.
 void setHangTimeout(long timeout)
           
 void setReaperSleep(long sleep)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentConnectionPool

public AgentConnectionPool(Resource r)
                    throws WavesetException
deprecated. See AgetnConnectionPool(Resource r, LighthouseContext ctx). A pool of agent connections to a single remote agent.


AgentConnectionPool

public AgentConnectionPool(Resource r,
                           LighthouseContext ctx)
                    throws WavesetException
Method Detail

setHangTimeout

public void setHangTimeout(long timeout)

setReaperSleep

public void setReaperSleep(long sleep)

reapConnections

public void reapConnections()

checkHungConnections

public void checkHungConnections()

closeConnections

public void closeConnections()

shutdown

public void shutdown()

getConnection

public RASecureConnection getConnection()
                                 throws java.io.IOException,
                                        java.lang.InterruptedException,
                                        java.security.InvalidKeyException
Return a connected connection. Because there is a limit on the number of concurrent connections, block if the pool is full and busy. This is a synchronized method so it is safe to call from many contexts.

Throws:
java.io.IOException
java.lang.InterruptedException
java.security.InvalidKeyException

returnConnection

public void returnConnection(RASecureConnection conn,
                             boolean isBogus)
Return a connection to the pool. If (isBogus), the connection is deleted and not returned to the pool.


matchResource

public boolean matchResource(Resource r)
If the class, port, and host match, return true. This means that this pool is a valid place to get a connection to the passed in resource


getPoolFreeCount

public int getPoolFreeCount()
                     throws WavesetException
Test method to check the pool status NOT FOR PUBLIC CONSUMPTION (not synchronized or anything)

Throws:
WavesetException

getPoolInUseCount

public int getPoolInUseCount()
                      throws WavesetException
Test method to check the pool status NOT FOR PUBLIC CONSUMPTION (not synchronized or anything)

Throws:
WavesetException

checkPoolCountValid

public boolean checkPoolCountValid()
                            throws WavesetException
Test method to check the pool status NOT FOR PUBLIC CONSUMPTION (not synchronized or anything)

Throws:
WavesetException

getResource

public Resource getResource()
Test method to show the pool name, resource, type, graphically


getName

public java.lang.String getName()