|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eaglei.repository.servlet.WithRepositoryConnection
public class WithRepositoryConnection
Give wrapped servlet a Sesame repository connection with automatic cleanup. Opens a new connection for each request and ensures it is closed at the end. WARNING: It is the servlet implementation's responsibility to commit() all changes made on the RepositoryConnection. This filter ONLY closes the connection (with a rollback if necessary), it does NOT commit anything, since it might regain control after an exception, in which case you wouldn't want any partial changes committed. XXX FIXME MAYBE: Is it worth using a pool of RepositoryConnections for efficiency? Maybe they are just too cheap to set up. Need to check if it is safe to reuse a connection after commit/rollback too. see http://commons.apache.org/pool/
| Constructor Summary | |
|---|---|
WithRepositoryConnection()
|
|
| Method Summary | |
|---|---|
void |
destroy()
destroy |
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp,
javax.servlet.FilterChain fc)
|
static org.openrdf.repository.RepositoryConnection |
get(javax.servlet.ServletRequest request)
Gets RepositoryConnection from where the filter stashed it. |
void |
init(javax.servlet.FilterConfig fc)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WithRepositoryConnection()
| Method Detail |
|---|
public void init(javax.servlet.FilterConfig fc)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterjavax.servlet.ServletExceptionpublic void destroy()
destroy
destroy in interface javax.servlet.Filterpublic static org.openrdf.repository.RepositoryConnection get(javax.servlet.ServletRequest request)
request - a ServletRequest object.
RepositoryConnection object.
public void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp,
javax.servlet.FilterChain fc)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.Filterjava.io.IOException
javax.servlet.ServletException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||