|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.SynchronizedRequestHandler
public abstract class SynchronizedRequestHandler
RequestHandler which takes care of locking and unlocking of the VaadinSession
automatically. The session is locked before
synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)
is called and unlocked after it has completed.
Constructor Summary | |
---|---|
SynchronizedRequestHandler()
|
Method Summary | |
---|---|
protected boolean |
canHandleRequest(VaadinRequest request)
Check whether a request may be handled by this handler. |
boolean |
handleRequest(VaadinSession session,
VaadinRequest request,
VaadinResponse response)
Called when a request needs to be handled. |
abstract boolean |
synchronizedHandleRequest(VaadinSession session,
VaadinRequest request,
VaadinResponse response)
Identical to handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
except the VaadinSession is locked before this is called and
unlocked after this has completed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SynchronizedRequestHandler()
Method Detail |
---|
public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws java.io.IOException
RequestHandler
true
to indicate that no more request
handlers should be invoked for the request.
Note that request handlers by default do not lock the session. If you are
using VaadinSession or anything inside the VaadinSession you must ensure
the session is locked. This can be done by extending
SynchronizedRequestHandler
or by using
VaadinSession.accessSynchronously(Runnable)
or
UI.accessSynchronously(Runnable)
.
handleRequest
in interface RequestHandler
session
- The session for the requestrequest
- The request to handleresponse
- The response object to which a response can be written.
java.io.IOException
- If an IO error occurredpublic abstract boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws java.io.IOException
handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
except the VaadinSession
is locked before this is called and
unlocked after this has completed.
session
- The session for the requestrequest
- The request to handleresponse
- The response object to which a response can be written.
java.io.IOException
- If an IO error occurredhandleRequest(VaadinSession, VaadinRequest, VaadinResponse)
protected boolean canHandleRequest(VaadinRequest request)
true
which means that all requests will be handled by
calling
synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)
with the session locked.
request
- the request to handle
true
if the request handling should continue once
the session has been locked; false
if there's no
need to lock the session since the request would still not be
handled.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |