|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.trippi.impl.base.ConfigurableSessionPool
public class ConfigurableSessionPool
A configurable TriplestoreSessionPool
that proactively
increases pool size.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ConfigurableSessionPool(TriplestoreSessionFactory factory,
int initialSize,
int maxGrowth,
int spareSessions)
Initialize the pool and grow it to its initial size. |
Method Summary | |
---|---|
void |
close()
Close all sessions. |
void |
finalize()
Call close() at garbage collection time in case it hasn't been called yet. |
TriplestoreSession |
get()
Get a connection from the pool. |
int |
getFreeCount()
Get the number of sessions not currently in use. |
int |
getInUseCount()
Get the number of sessions currently in use. |
java.lang.String[] |
listTripleLanguages()
|
java.lang.String[] |
listTupleLanguages()
|
void |
release(TriplestoreSession session)
Release a connection back to the pool. |
void |
run()
Maintain the pool size. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConfigurableSessionPool(TriplestoreSessionFactory factory, int initialSize, int maxGrowth, int spareSessions) throws TrippiException
initialSize
- number of sessions to start with.maxGrowth
- max additional sessions to add. If -1, no
limit will be placed on the size.spareSessions
- number of unused sessions to keep available.
Zero means new sessions will only be created
on demand. Note if maxGrowth is 0, the
value of this parameter is inconsequential.
TrippiException
Method Detail |
---|
public java.lang.String[] listTripleLanguages()
listTripleLanguages
in interface TriplestoreSessionPool
public java.lang.String[] listTupleLanguages()
listTupleLanguages
in interface TriplestoreSessionPool
public TriplestoreSession get() throws TrippiException
get
in interface TriplestoreSessionPool
TrippiException
- if there were no spare sessions and an
attempt to create one on-demand failed.public void release(TriplestoreSession session)
release
in interface TriplestoreSessionPool
public int getInUseCount()
getInUseCount
in interface TriplestoreSessionPool
public int getFreeCount()
getFreeCount
in interface TriplestoreSessionPool
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void close() throws TrippiException
close
in interface TriplestoreSessionPool
TrippiException
public void finalize() throws TrippiException
finalize
in class java.lang.Object
TrippiException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |