org.openrdf.http.server.repository
Class RepositoryInterceptor
java.lang.Object
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
org.openrdf.http.server.ServerInterceptor
org.openrdf.http.server.repository.RepositoryInterceptor
- All Implemented Interfaces:
- org.springframework.web.servlet.HandlerInterceptor
public class RepositoryInterceptor
- extends ServerInterceptor
Interceptor for repository requests. Handles the opening and closing of
connections to the repository specified in the request. Should not be a
singleton bean! Configure as inner bean in openrdf-servlet.xml
- Author:
- Herko ter Horst, Arjohn Kampman
| Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter |
postHandle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RepositoryInterceptor
public RepositoryInterceptor()
setRepositoryManager
public void setRepositoryManager(LocalRepositoryManager repMan)
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse respons,
Object handler)
throws Exception
- Specified by:
preHandle in interface org.springframework.web.servlet.HandlerInterceptor- Overrides:
preHandle in class ServerInterceptor
- Throws:
Exception
getThreadName
protected String getThreadName()
- Description copied from class:
ServerInterceptor
- Determine the thread name to use. Called before the request is forwarded
to a handler.
- Specified by:
getThreadName in class ServerInterceptor
- Returns:
- a name that makes sense based on the request
setRequestAttributes
protected void setRequestAttributes(javax.servlet.http.HttpServletRequest request)
throws ClientHTTPException,
ServerHTTPException
- Description copied from class:
ServerInterceptor
- Set attributes for this request. Called before the request is forwarded to
a handler. By default, this method does nothing.
- Overrides:
setRequestAttributes in class ServerInterceptor
- Parameters:
request - the request
- Throws:
ClientHTTPException - if it was impossible to set one or more attributes due to a bad
request on the part of the client
ServerHTTPException - if it was impossible to set one or more attributes due to an
internal error
cleanUpResources
protected void cleanUpResources()
throws ServerHTTPException
- Description copied from class:
ServerInterceptor
- Clean up resources used in handling this request. Called after the request
is handled and a the view is rendered (or an exception has occurred). By
default, this method does nothing.
- Overrides:
cleanUpResources in class ServerInterceptor
- Throws:
ServerHTTPException - if some resources could not be cleaned up because of an internal
error
getRepositoryID
public static String getRepositoryID(javax.servlet.http.HttpServletRequest request)
getRepository
public static Repository getRepository(javax.servlet.http.HttpServletRequest request)
getRepositoryConnection
public static RepositoryConnection getRepositoryConnection(javax.servlet.http.HttpServletRequest request)
Copyright © 2001-2007 Aduna. All Rights Reserved.