public final class SharedSessionPool extends Object implements ISessionPool
session pool
that is not closable and hence can be shared between
different applications/datastores when referenced by a JNDI context.Modifier | Constructor and Description |
---|---|
protected |
SharedSessionPool(ISessionPool delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close()
closes all connections in this pool.
|
protected void |
finalize() |
int |
getAvailableCount()
Returns the number of idle connections
|
ArcSDEConnectionConfig |
getConfig() |
static ISessionPool |
getInstance(ArcSDEConnectionConfig config,
ISessionPoolFactory factory) |
int |
getInUseCount()
Number of active sessions.
|
int |
getPoolSize()
returns the number of actual connections held by this connection pool.
|
ISession |
getSession()
Shortcut for
getSession(true) |
ISession |
getSession(boolean transactional)
Grab a session from the pool, this session is the responsibility of the calling code and must
be closed after use.
|
boolean |
isClosed()
Returns whether this pool is closed
|
String |
toString() |
protected SharedSessionPool(ISessionPool delegate) throws IOException
IOException
public static ISessionPool getInstance(ArcSDEConnectionConfig config, ISessionPoolFactory factory) throws IOException
IOException
public void close()
ISessionPool
close
in interface ISessionPool
ISessionPool.close()
public int getAvailableCount()
ISessionPool
getAvailableCount
in interface ISessionPool
ISessionPool.getAvailableCount()
public ArcSDEConnectionConfig getConfig()
getConfig
in interface ISessionPool
ISessionPool.getConfig()
public int getInUseCount()
ISessionPool
getInUseCount
in interface ISessionPool
ISessionPool.getInUseCount()
public int getPoolSize()
ISessionPool
getPoolSize
in interface ISessionPool
ISessionPool.getPoolSize()
public ISession getSession() throws IOException, UnavailableConnectionException
ISessionPool
getSession(true)
getSession
in interface ISessionPool
IOException
UnavailableConnectionException
ISessionPool.getSession()
public ISession getSession(boolean transactional) throws IOException, UnavailableConnectionException
ISessionPool
getSession
in interface ISessionPool
transactional
- whether the session is intended to be used on a transaction, so the pool
may choose to reuse or not a connection.IOException
- If we could not get a connectionUnavailableConnectionException
- If we are out of connectionsISessionPool.getSession(boolean)
public boolean isClosed()
ISessionPool
isClosed
in interface ISessionPool
ISessionPool.isClosed()
Copyright © 1996–2019 Geotools. All rights reserved.