| Free tutorials for Java, Eclipse and Web programming |
Version 2.7
Copyright © 2009 - 2011 Lars Vogel
12.03.2010
| Revision History | ||
|---|---|---|
| Revision 0.1 | 08.04.2009 | Lars Vogel |
| Created | ||
| Revision 0.2 - 2.7 | 25.04.2009 - 12.03.2010 | Lars Vogel |
| bug fixes and enhancements | ||
Table of Contents
Google offers a cloud computing infrastructure called Google App Engine (App Engine) for creating and running web applications . App Engine allows the dynamic allocation of system resources for an application based on the actual demand. Currently App Engine supports Python and Java based applications. This includes Java Virtual Machine (JVM) based languages, e.g. Groovy or Scala . This article will cover the App Engine for Java (GAE/J)).
The App Engine offers frequently standard Java API's and App Engine specific API's for the same task. If you want to be able to port your application from the AppEngine to other webcontainers, e.g. Tomcat or Jetty, you should only use Java standard API.
App Engine uses the Jetty servlet container to host applications and supports the Java Servlet API in version 2.4. It provides access to databases via Java Data Objects (JDO) and the Java Persistence API (JPA) . In the background App Engine uses Google Bigtable as the distributed storage system for persisting application data.
Google provides Memcache as a caching mechanism. Developers who want to code against the standard Java API can use the JCache implementation (based on JSR 107).
The App Engine provides several services. For example the Blobstore allows to upload and store and serve large data objects (blobs) with a limit of 2 Gigabyte. To create a blob you upload a file via an HTTP request.
Google App Engine supports the creation of several version of your application. In the Admin Console you can select which version should be active. Your active application "your-name" will be accessible via the URL "http://your-name.appspot.com". Each version can also be accessed for example to test a new version. The version are accessable via "http://versionnumber.latest.your-name.appspot.com" where version is for example "2" and "latest" is a fixed string.
App Engine runs a version of Java 6 but does not provide all Java classes, for example Swing and most AWT classes are not supported.
You cannot use Threads or frameworks which uses Threads. You can also not write to the filesystem and only read files which are part of your application. Certain "java.lang.System" actions, e.g. gc() or exit() will do nothing. You can not call JNI code. Reflection is possible for your own classes and standard Java classes but your cannot use reflection to access other classes outside your application.
See Java Whitelist for a full list of supported classes.
A servlet needs also to reply within 30 seconds otherwise a "com.google.apphosting.api.DeadlineExceededException" is thrown.
Google offers free hosting for websites which are not highly frequented, e.g. 5 Millions page views. The price model for the websites that exceed thier daily quota is listed on the Google billing documentation pages . The usage quotas of the App Engine are constantly changing but, at the time of this writing, are around 5 millions pages views per month, which translates approx. in 6.5 CPU hours and 1 gigabyte of outbound traffic.
Currently a user can create a maximum of 10 applications on the Google App Engine. The user can delete existing application in the Admin Console under Application Settings.