CS6320:  SW Engineering of Web Based Systems

 

GAE: Runtime Environment (featuring Java)

 

  • The runtime environment includes the interpreter that executes the code (either the Python interpreter or the Java virtual machine), the application's memory, a read-only filesystem with the application's resource files, and APIs to the App Engine services.

 

Java

  • The Java runtime environment behaves like a servlet container.
  • When the app server receives a request, it determines the servlet class to call by comparing the URL path to
    the servlet mappings in the deployment descriptor

 

Getting System Information in code

An app can ask for information about the current environment using the SystemProperty API, in the com.google.appengine.api.utils package. App Engine sets static fields of this class to the application ID (applicationId), the application version (applicationVersion), the version of the runtime environment (version), and whether the app is running in the development environment or on App Engine (environment).

   import com.google.appengine.api.utils.SystemProperty;
   // ...get Application ID
   String applicationId = SystemProperty.applicationId.get();

// see if system is development server if (SystemProperty.environment.value() == SystemProperty.Environment.Value.Development) { // ... only executed in the development server ... }

 

 

© Lynne Grewe