Package com.gigaspaces.proxy_pool
Class SpaceProxyPool
java.lang.Object
com.gigaspaces.proxy_pool.SpaceProxyPool
- Since:
- 16.0.
- Author:
- Meshi Ruff
-
Constructor Summary
ConstructorsConstructorDescriptionSpaceProxyPool(int capacity, long expirationTime, long waitingTimeout, SpaceProxyPoolFactory spaceProxyPoolFactory) Constructor for tests.SpaceProxyPool(SpaceProxyPoolFactory spaceProxyPoolFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidClear all connections from pool in case of openid IdP settings or roles in security service changedvoiddeleteLoggedOutSession(String sessionId) When a session is logged out, remove all connections of this sessionvoidevict()Evict the connections which pass the expiration time.longintgetOrCreate(IJSpace ijSpace, String sessionId, Properties props) Get connection for specific sessionId.intbooleanisSessionIdExists(String sessionId) voidputBack(GConnection gConnection, String sessionId, String spaceName) Put back the connection after usage
-
Constructor Details
-
SpaceProxyPool
-
SpaceProxyPool
public SpaceProxyPool(int capacity, long expirationTime, long waitingTimeout, SpaceProxyPoolFactory spaceProxyPoolFactory) Constructor for tests.
-
-
Method Details
-
getOrCreate
public GConnection getOrCreate(IJSpace ijSpace, String sessionId, Properties props) throws SQLException, TimeoutException, SpaceProxyPoolException, InterruptedException Get connection for specific sessionId. If sessionId does not exist, create new connection- Parameters:
ijSpace-sessionId-props-- Returns:
- gConnection
- Throws:
SQLExceptionTimeoutException- if timeout reached while waiting for connectionSpaceProxyPoolException- if the session expired while getting the connectionInterruptedException
-
putBack
public void putBack(GConnection gConnection, String sessionId, String spaceName) throws SpaceProxyPoolException Put back the connection after usage- Parameters:
gConnection-sessionId-spaceName-- Throws:
SpaceProxyPoolException- if the session expired while getting the connection
-
evict
Evict the connections which pass the expiration time. Runs periodically- Throws:
SQLException
-
deleteLoggedOutSession
When a session is logged out, remove all connections of this session- Parameters:
sessionId-
-
clearConnectionPool
public void clearConnectionPool()Clear all connections from pool in case of openid IdP settings or roles in security service changed -
getExpirationTime
public long getExpirationTime() -
getProxyCounter
public int getProxyCounter() -
isSessionIdExists
-
getHashMapSize
public int getHashMapSize()
-