com.vaadin.server.communication.
Class UIInitHandler
- java.lang.Object
-
- com.vaadin.server.SynchronizedRequestHandler
-
- com.vaadin.server.communication.UIInitHandler
-
All Implemented Interfaces:
Direct Known Subclasses:
public abstract class UIInitHandler extends SynchronizedRequestHandler
Handles an initial request from the client to initialize a
UI
.Since:
7.1
Author:
Vaadin Ltd
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.server.SynchronizedRequestHandler
SynchronizedRequestHandler.ResponseWriter
-
-
Field Summary
Fields Modifier and Type Field Description static String
BROWSER_DETAILS_PARAMETER
-
Fields inherited from class com.vaadin.server.SynchronizedRequestHandler
MAX_BUFFER_SIZE
-
-
Constructor Summary
Constructors Constructor Description UIInitHandler()
-
Method Summary
All Methods Modifier and Type Method Description protected boolean
canHandleRequest(VaadinRequest request)
Check whether a request may be handled by this handler.
protected String
getEmbedId(VaadinRequest request)
Constructs an embed id based on information in the request.
protected String
getInitialUidl(VaadinRequest request, UI uI)
Generates the initial UIDL message that can e.g.
protected abstract boolean
isInitRequest(VaadinRequest request)
boolean
synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response)
Identical to
SynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
except theVaadinSession
is locked before this is called and unlocked after this has completed.-
Methods inherited from class com.vaadin.server.SynchronizedRequestHandler
getRequestBody, handleRequest, isReadAndWriteOutsideSessionLock, synchronizedHandleRequest
-
-
-
-
Field Detail
-
BROWSER_DETAILS_PARAMETER
public static final String BROWSER_DETAILS_PARAMETER
See Also:
-
-
Method Detail
-
isInitRequest
protected abstract boolean isInitRequest(VaadinRequest request)
-
canHandleRequest
protected boolean canHandleRequest(VaadinRequest request)
Description copied from class:
SynchronizedRequestHandler
Check whether a request may be handled by this handler. This can be used as an optimization to avoid locking the session just to investigate some method property. The default implementation just returns
true
which means that all requests will be handled by callingSynchronizedRequestHandler.synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)
with the session locked.Overrides:
canHandleRequest
in classSynchronizedRequestHandler
Parameters:
request
- the request to handleReturns:
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.
-
synchronizedHandleRequest
public boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException
Description copied from class:
SynchronizedRequestHandler
Identical to
SynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
except theVaadinSession
is locked before this is called and unlocked after this has completed.Specified by:
synchronizedHandleRequest
in classSynchronizedRequestHandler
Parameters:
session
- The session for the requestrequest
- The request to handleresponse
- The response object to which a response can be written.Returns:
true if a response has been written and no further request handlers should be called, otherwise false
Throws:
IOException
- If an IO error occurredSee Also:
SynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
-
getEmbedId
protected String getEmbedId(VaadinRequest request)
Constructs an embed id based on information in the request.
Parameters:
request
- the request to get embed information fromReturns:
the embed id, or
null
if id is not available.Since:
7.2
See Also:
-
getInitialUidl
protected String getInitialUidl(VaadinRequest request, UI uI) throws IOException
Generates the initial UIDL message that can e.g. be included in a html page to avoid a separate round trip just for getting the UIDL.
Parameters:
request
- the request that caused the initializationuI
- the UI for which the UIDL should be generatedReturns:
a string with the initial UIDL message
Throws:
-
-