org.trippi.impl.base
Class SingleSessionPool

java.lang.Object
  extended by org.trippi.impl.base.SingleSessionPool
All Implemented Interfaces:
TriplestoreSessionPool

public class SingleSessionPool
extends java.lang.Object
implements TriplestoreSessionPool

A pool providing access to a single session.


Constructor Summary
SingleSessionPool(TriplestoreSession session, java.lang.String[] tupleLanguages, java.lang.String[] tripleLanguages)
           
 
Method Summary
 void close()
          Close all sessions.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleSessionPool

public SingleSessionPool(TriplestoreSession session,
                         java.lang.String[] tupleLanguages,
                         java.lang.String[] tripleLanguages)
Method Detail

get

public TriplestoreSession get()
Description copied from interface: TriplestoreSessionPool
Get a connection from the pool.

Specified by:
get in interface TriplestoreSessionPool
Returns:
a session, or null if none are available and growth isnt allowed.

release

public void release(TriplestoreSession session)
Description copied from interface: TriplestoreSessionPool
Release a connection back to the pool.

Specified by:
release in interface TriplestoreSessionPool

listTupleLanguages

public java.lang.String[] listTupleLanguages()
Specified by:
listTupleLanguages in interface TriplestoreSessionPool

listTripleLanguages

public java.lang.String[] listTripleLanguages()
Specified by:
listTripleLanguages in interface TriplestoreSessionPool

getInUseCount

public int getInUseCount()
Description copied from interface: TriplestoreSessionPool
Get the number of sessions currently in use.

Specified by:
getInUseCount in interface TriplestoreSessionPool

getFreeCount

public int getFreeCount()
Description copied from interface: TriplestoreSessionPool
Get the number of sessions not currently in use.

Specified by:
getFreeCount in interface TriplestoreSessionPool

close

public void close()
           throws TrippiException
Description copied from interface: TriplestoreSessionPool
Close all sessions.

Specified by:
close in interface TriplestoreSessionPool
Throws:
TrippiException