public class OpenSessionInViewInterceptor extends java.lang.Object implements AsyncWebRequestInterceptor
A WebRequestInterceptor instance that handles opening a Datastore session within the scope of a request.
A request that finds a session already bound, such as an include within a request that opened one, uses that session and leaves it to the one that opened it. When a request goes asynchronous, the session it opened is flushed and closed as when the request completes, so that it does not stay bound to the thread for the next request that thread serves.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
afterCompletion(WebRequest webRequest, java.lang.Exception e) |
|
public void |
afterConcurrentHandlingStarted(WebRequest webRequest)Called instead of postHandle and afterCompletion on the thread that started asynchronous handling. |
|
public Datastore |
getDatastore() |
|
protected boolean |
hasSessionBound() |
|
public void |
postHandle(WebRequest webRequest, ModelMap modelMap) |
|
public void |
preHandle(WebRequest webRequest) |
|
public void |
setDatastore(Datastore datastore) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Called instead of postHandle and afterCompletion on the thread that started asynchronous handling. Flushes the session this interceptor opened, as postHandle would, and closes it, so that the thread goes back to its pool without a session bound.