You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

advanced-gae.asciidoc 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ---
  2. title: Google App Engine Integration
  3. order: 7
  4. layout: page
  5. ---
  6. [[advanced.gae]]
  7. = Google App Engine Integration
  8. __This section is not yet fully updated to Vaadin 7.__
  9. Vaadin includes support to run Vaadin applications in the Google App Engine
  10. (GAE). The most essential requirement for GAE is the ability to serialize the
  11. application state. Vaadin applications are serializable through the
  12. [classname]#java.io.Serializable# interface.
  13. To run as a GAE application, an application must use
  14. [classname]#GAEVaadinServlet# instead of [classname]#VaadinServlet#, and of
  15. course implement the [classname]#java.io.Serializable# interface for all
  16. persistent classes. You also need to enable session support in
  17. [filename]#appengine-web.xml# with:
  18. [source, xml]
  19. ----
  20. <sessions-enabled>true</sessions-enabled>
  21. ----
  22. The Vaadin Project wizard can create the configuration files needed for GAE
  23. deployment. See
  24. <<dummy/../../../framework/getting-started/getting-started-first-project#getting-started.first-project.creation,"Creating
  25. the Project">>. When the Google App Engine deployment configuration is selected,
  26. the wizard will create the project structure following the GAE Servlet
  27. convention instead of the regular Servlet convention. The main differences are:
  28. * Source directory: [filename]#src/main/java#
  29. * Output directory: [filename]#war/WEB-INF/classes#
  30. * Content directory: [filename]#war#
  31. == Rules and Limitations
  32. Running Vaadin applications in Google App Engine has the following rules and
  33. limitations:
  34. * Avoid using the session for storage, usual App Engine limitations apply (no
  35. synchronization, that is, it is unreliable).
  36. * Vaadin uses memcache for mutex, the key is of the form
  37. [parameter]#_vmutex&lt;sessionid&gt;#.
  38. * The Vaadin [classname]#WebApplicationContext# class is serialized separately
  39. into memcache and datastore; the memcache key is [parameter]#_vac&lt;sessionid&gt;#
  40. and the datastore entity kind is [parameter]#_vac# with identifiers of the type
  41. [parameter]#_vac&lt;sessionid&gt;#.
  42. * __Do not__ update the application state when serving an
  43. [classname]#ConnectorResource# (such as [classname]#ClassResource#.
  44. [methodname]#getStream()#).
  45. * __Avoid__ (or be very careful when) updating application state in a
  46. [classname]#TransactionListener# - it is called even when the application is not
  47. locked and won't be serialized (such as with [classname]#ConnectorResource#),
  48. and changes can therefore be lost (it should be safe to update things that can
  49. be safely discarded later, that is, valid only for the current request).
  50. * The application remains locked during uploads - a progress bar is not possible.