class NGSessionPool
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
done
have we been shut down?
|
private java.lang.Object |
lock
synchronization object
|
(package private) NGSession[] |
pool
the pool itself
|
(package private) int |
poolEntries
The number of sessions currently in the pool
|
(package private) int |
poolSize
number of sessions to store in the pool
|
(package private) NGServer |
server
reference to server we're working for
|
Constructor and Description |
---|
NGSessionPool(NGServer server,
int poolsize)
Creates a new NGSessionRunner operating for the specified server, with
the specified number of threads
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
give(NGSession session)
Returns an NGSession to the pool.
|
(package private) void |
shutdown()
Shuts down the pool.
|
(package private) NGSession |
take()
Returns an NGSession from the pool, or creates one if necessary
|
int poolSize
NGSession[] pool
int poolEntries
NGServer server
boolean done
private java.lang.Object lock
NGSessionPool(NGServer server, int poolsize)
server
- the server to work forpoolsize
- the maximum number of idle threads to allowNGSession take()
void give(NGSession session)
session
- the NGSession to return to the poolvoid shutdown()