Properly cleanup stream variables if DragAndDropWrapper is detached (#14882)
If DragAndDropWrapper is removed from the UI for whatever reason before cleanup
happens, the UI can no longer be found through it. If we do not do cleanup, we
leave a reference hanging forever in ConnectorTracker.
Change-Id: I9fc3da5d616276a7810ddc4a18cbebf8621635fe
* ConnectorTracker.getConnector() is now DnDService-aware
* Deprecated LCM.getDragAndDropService() is removed
* LCM.getConnector() simply delegates to ConnectorTracker.getConnector()
Change-Id: I9627d50f7386ead8d92ccbba27b4a558c03076c7
reduce frequency of session locking and StreamingProgressEvents (#13155)
This change introduces throttling of streaming progress events. Before
a event was fired once a buffer was filled. However as the buffer is only
4kb in size, fast uploads would trigger massive amounts of events.
This change is backwards incompatible on a logical level. Before this
change, a listener would get contentLength/4kb events, while after this
change the amount is limited to one progress event per 500ms.
Change-Id: I5da092ec4488971b8554b68b44c346057bfcc0e0
When another threads interrupts the Upload, the UploadInterruptedException is
thrown. The respective StreamVariable will receive
streamingFailed(StreamingErrorEvent event) which contains the causing exception
via event.getException(). When the UploadInterruptedException is not public, it
is impossible to react on it in the StreamVariable (e.g. treating an
IOException differently from an UploadInterruptedException).
Change-Id: I9098e70e6750c420fcc0978340544e545e237b26
Support uploading files larger 2GB via drag and drop and file input (#11947).
Vaadin mostly just passes through the value from the Javascript File object
on drag and drop. As per specification (http://www.w3.org/TR/file-upload/#blob)
the size value can be "long". The size attribute of Html5File was already long,
but this patch makes sure long values actually are transported correctly from
the client side Transferable. Additionally, the file upload handling in
FileUploadHandler was determining the length of the upload via the Servlet Spec
getContentLength method of the request. However the spec was written at a time
where 2GB were unthinkable. Luckily containers return this value by querying
the Content-Length header, which can transport values of "long". So instead of
using the Servlet Spec method, FileUploadHandler evaluates the header itself.
AbstractStreamingEvent already was supporting "long" values. For Drag&Drop,
the file size needs to be serialized as double, because long is not supported
in JSNI.
Change-Id: I606fca7430c65c20144793fa011cb2f6ee3a0415
Refactored how all requests are handled by VaadinServlet and VaadinPortlet (#11192)
* Handling is now based on a list of RequestHandlers in VaadinService
* Request handling logic has been moved to VaadinService
* Users can customize the list by adding own (service level) request handlers
* For users specific request handlers you can still use the request handlers in VaadinSession
* Deprecated RequestType - all handlers are given the opportunity to handle a request until one of them chooses to handle it. RequestType makes no sense as it does not tell which handler will handle the request.
* Removed serveStaticResource which has never been used
Change-Id: Ia7d088535e46430ca8adf631d3f1dd944b9d51e2
* Move UIDL writing from AbstractCommunicationManager to UidlWriter
* Move request handling from ACM to RequestHandlers
* Move server RPC message handling to ServerRpcHandler
* Move portlet event notifications to PortletListenerNotifier (a RequestHandler)
* Communication handlers reside in c.v.server.communication
Change-Id: I087e923dbdf88c6b3fcaafbdb7f685d9d3dad0c1