ServerPush - Vaadin Add-on Directory
ServerPush for Vaadin
A component that adds TRUE push support with a variety of push methods to Vaadin!
There are two methods for using this add-on:
1) Use regular Vaadin servlet and manually add ServerPush widget to application as well as manually call push() when you want to push to client(s)
2) Use ServerPushApplicationServlet instead of the default Vaadin servlet (ServerPush widget is automatically added at the bottom of main window upon new Application creation)
The difference between the two methods is that the former requires explicit calling of push() by the developer, which allows the developer control over when updates are pushed, whereas the latter method provides a seamless push on every repaint request with no explicit calls to push(). The latter method is also much more aggressive in pushing updates to the client(s) since it is invoked on every repaint request.
This component is based on the Atmosphere Framework 0.7.2, which can be configured to use one of four push methods:
1) Blocking I/O (also acts as a fallback for the next three)
2) Native Comet support in app server
3) Servlet 3.0 Async
4) WebSockets
The best available method will be chosen unless explicitly told which method to use in the Atmosphere servlet configuration.
Make sure that you add the Atmosphere and SLF4J JARs to your WEB-INF/lib. Note that Atmosphere uses SLF4J and this add-on only includes the API JAR; therefore, users of this add-on will need to add a concrete implementation of this API to the app (log4j, java.util, simple, etc.).
NOTE: All samples are in GitHub; they are not included in the download.
**********************************************************************************************
NOTE: This add-on is no longer actively developed. I have moved my efforts to DontPush OzoneLayer in conjunction with Matti Tahvonen which is a much more elegant solution that does not require a Component to be added to a Window. New project at: https://vaadin.com/directory#addon/dontpush-ozonelayer
**********************************************************************************************
Author Homepage
Discussion Forum
Issue Tracker
Source Code
ServerPush version 1.0.0
Initial version
ServerPush version 1.0.2
- Fixed NullPointerException due to main window not being initialized yet
ServerPush version 1.0.3
- Fixed problem whereby ServerPush component was removed if setContent() was called on mainWindow during init()
ServerPush version 1.0.4
- Fixed issue with context path being null when accessed from separate thread
- Fixed backwards logic that always set context path to null in VServerPush
ServerPush version 1.0.5
- Added the ability to configure the AtmosphereHandler to user a channel-per-application-instance approach instead of a global push channel. Turn this on by adding in atmosphere.xml under the heartbeat property.
- Added a sample application that uses a global push channel with the manual process (nothing flashy, not even good code; just a sample)
- Re-organized code to Maven standard to (hopefully) include a Maven build process soon
ServerPush version 1.0.6
- Updated ServerPushCommunicationManager to only push to clients after every repaint request is complete instead of on every repaint request. Only applicable if using ServerPushApplicationServlet. Thanks to Matti Tahvonen for the suggestion.
- Added javadocs
ServerPush version 1.0.7
Fix potential red wheel on application close. Patch by Fabian Lange.