Class ApiServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.google.appengine.tools.development.ApiServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ApiServlet extends javax.servlet.http.HttpServlet
Servlet handling POST requests to serve App Engine Standard API calls implemented by the API stub implementations used by the dev app server. This can be used in a local dev environment to emulate App Engine APIs, or in a test environment. The protocol buffer used is the same as the App Engine remote APIs documented at https://cloud.google.com/appengine/docs/standard/java/tools/remoteapi and the one used from the Java clones in production to make API calls.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
    void
    init(javax.servlet.ServletConfig config)
    Configure the APIServlet with 2 servlet init paramerters:

    Methods inherited from class javax.servlet.http.HttpServlet

    service

    Methods inherited from class javax.servlet.GenericServlet

    getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ApiServlet

      public ApiServlet()
  • Method Details

    • init

      public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
      Configure the APIServlet with 2 servlet init paramerters:
       java_runtime_port:  the local port of the java clone. This is needed for the taskqueue APIs to
       be able to post callback to the clone.
       java_runtime_host:  the hostname of the java clone. (default to localhost).
          * executor_pool_size: size of the threadpool handling API calls. Default is 10.
       
      Specified by:
      init in interface javax.servlet.Servlet
      Overrides:
      init in class javax.servlet.GenericServlet
      Throws:
      javax.servlet.ServletException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface javax.servlet.Servlet
      Overrides:
      destroy in class javax.servlet.GenericServlet
    • doPost

      public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
      Throws:
      IOException