Package com.vaadin.server.communication
Class UidlRequestHandler
- java.lang.Object
-
- com.vaadin.server.SynchronizedRequestHandler
-
- com.vaadin.server.communication.UidlRequestHandler
-
- All Implemented Interfaces:
RequestHandler,SessionExpiredHandler,Serializable
public class UidlRequestHandler extends SynchronizedRequestHandler implements SessionExpiredHandler
Processes a UIDL request from the client. UsesServerRpcHandlerto execute client-to-server RPC invocations andUidlWriterto write state changes and client RPC calls back to the client.- Since:
- 7.1
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UidlRequestHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanHandleRequest(VaadinRequest request)Check whether a request may be handled by this handler.protected voidcloseJsonMessage(Writer outWriter)protected ServerRpcHandlercreateRpcHandler()Creates the ServerRpcHandler to use.booleanhandleSessionExpired(VaadinRequest request, VaadinResponse response)Called when the a session expiration has occurred and a notification needs to be sent to the user.protected voidopenJsonMessage(Writer outWriter, VaadinResponse response)Writes the opening of JSON message to be sent to client.booleansynchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response)Identical toSynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)except theVaadinSessionis locked before this is called and unlocked after this has completed.-
Methods inherited from class com.vaadin.server.SynchronizedRequestHandler
handleRequest
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.RequestHandler
handleRequest
-
-
-
-
Field Detail
-
UIDL_PATH
public static final String UIDL_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
createRpcHandler
protected ServerRpcHandler createRpcHandler()
Creates the ServerRpcHandler to use.- Returns:
- the ServerRpcHandler to use
- Since:
- 7.7
-
canHandleRequest
protected boolean canHandleRequest(VaadinRequest request)
Description copied from class:SynchronizedRequestHandlerCheck 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 returnstruewhich means that all requests will be handled by callingSynchronizedRequestHandler.synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)with the session locked.- Overrides:
canHandleRequestin classSynchronizedRequestHandler- Parameters:
request- the request to handle- Returns:
trueif the request handling should continue once the session has been locked;falseif 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:SynchronizedRequestHandlerIdentical toSynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)except theVaadinSessionis locked before this is called and unlocked after this has completed.- Specified by:
synchronizedHandleRequestin 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 occurred- See Also:
SynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
-
closeJsonMessage
protected void closeJsonMessage(Writer outWriter) throws IOException
- Throws:
IOException
-
openJsonMessage
protected void openJsonMessage(Writer outWriter, VaadinResponse response) throws IOException
Writes the opening of JSON message to be sent to client.- Parameters:
outWriter-response-- Throws:
IOException
-
handleSessionExpired
public boolean handleSessionExpired(VaadinRequest request, VaadinResponse response) throws IOException
Description copied from interface:SessionExpiredHandlerCalled when the a session expiration has occurred and a notification needs to be sent to the user. If a response is written, this method should returntrueto indicate that no moreSessionExpiredHandlerhandlers should be invoked for the request.- Specified by:
handleSessionExpiredin interfaceSessionExpiredHandler- Parameters:
request- 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 occurred
-
-