Package com.kheops.jmap.net
Class JMapServerRemoteConnectionPool
- All Implemented Interfaces:
KSchedulerClient
A class that manages a pool of connections to remote instance of JMapServer.
A unique session is opened on the remote server and it is available through the
method getSessionId() to be used by all connections of the pool.
-
Field Summary
Fields inherited from class com.kheops.util.KObjectPool
cleanupPeriod, recyclePeriod, shrinkTime, TIMEOUT_UNDEFINED, TIMEOUT_UNLIMITED -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new JMapServerRemoteConnectionPool instance.Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidGets a free connection from the connection poolborrowConnection(long timeout, TimeUnit unit) Gets a free connection from the connection poolcreate()Creates the object encapsulating the appropriate objectvoidvoidexpire(JMapConnection connection) This method closes the objectprotected intgetId()protected longbooleaninit(JMapServerRemoteConnectionPoolInfo poolInfo) Initializes the connection pool with the specified pool info.protected voidbooleanvoidprotected voidNo-op hook that allows implementation instructions after resource creation.voidreturnConnection(JMapConnection connection) This method will free up the specified connection instancebooleanvalidate(JMapConnection connection) This method checks if the specified object qualifies for connectionsMethods inherited from class com.kheops.util.KObjectPool
apply, checkIn, checkOut, checkOut, close, createUnlockedInstance, getDefaultTimeout, getMonitoringInfo, getPoolMaximumSize, getPoolSize, getPoolUsageCount, getPoolUsagePeak, initialize, initialize, initialize, reset, schCallback, setDefaultTimeout, setPoolMaximumSize, setPoolMinimumSize
-
Constructor Details
-
JMapServerRemoteConnectionPool
public JMapServerRemoteConnectionPool()Creates a new JMapServerRemoteConnectionPool instance.- Since:
- 6.5
- See Also:
-
JMapServerRemoteConnectionPool
@Deprecated public JMapServerRemoteConnectionPool(JMapServerRemoteConnectionPoolInfo poolInfo) throws Exception Deprecated.use the default constructor andinit(JMapServerRemoteConnectionPoolInfo)- Throws:
Exception
-
-
Method Details
-
init
Initializes the connection pool with the specified pool info.- Parameters:
poolInfo- all pool informations needed to initialize the connection pool.- Returns:
- true if no error occurred during the initialization.
- Since:
- 6.5
-
getJMapServerRemoteConnectionPoolInfo
-
create
Description copied from class:KObjectPoolCreates the object encapsulating the appropriate object- Specified by:
createin classKObjectPool<JMapConnection>- Returns:
- the corresponding object
- Throws:
IOException
-
expire
Description copied from class:KObjectPoolThis method closes the object- Specified by:
expirein classKObjectPool<JMapConnection>- Parameters:
connection- the object to be expired
-
getSystemDefaultTimeout
protected long getSystemDefaultTimeout()- Overrides:
getSystemDefaultTimeoutin classKObjectPool<JMapConnection>
-
validate
This method checks if the specified object qualifies for connections- Specified by:
validatein classKObjectPool<JMapConnection>- Parameters:
connection- the corresponding object- Returns:
- true if the object qualifies for connection false otherwise
-
getId
protected int getId()- Overrides:
getIdin classKObjectPool<JMapConnection>
-
internalErrorOccurred
- Overrides:
internalErrorOccurredin classKObjectPool<JMapConnection>
-
returnConnection
This method will free up the specified connection instance- Parameters:
connection- the corresponding connection instance to be freed
-
borrowConnection
Gets a free connection from the connection pool- Returns:
- a free JMapConnection instance from the connection pool
- Throws:
IOException
-
borrowConnection
Gets a free connection from the connection pool- Parameters:
timeout- the maximum time to waitunit- the time unit of the timeout argument- Returns:
- a free JMapConnection instance from the connection pool
- Throws:
IOException
-
resourceAdded
Description copied from class:KObjectPoolNo-op hook that allows implementation instructions after resource creation.- Overrides:
resourceAddedin classKObjectPool<JMapConnection>- Parameters:
o- the corresponding object
-
addListener
-
removeListener
-
isInactive
public boolean isInactive() -
activate
public void activate() -
deactivate
public void deactivate()
-
init(JMapServerRemoteConnectionPoolInfo)