public abstract class SynchronizedRequestHandler extends Object implements RequestHandler
synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)
is called and unlocked after it has completed.Constructor and Description |
---|
SynchronizedRequestHandler() |
Modifier and Type | Method and Description |
---|---|
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. |
public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws 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(Command)
or
UI.accessSynchronously(Command)
.
handleRequest
in interface RequestHandler
session
- The session for the requestrequest
- The request to handleresponse
- The response object to which a response can be written.IOException
- If an IO error occurredpublic abstract boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws 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.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 handletrue
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.Copyright © 2025. All rights reserved.