ApiProxy (Google App Engine API for Java)


Class ApiProxy

  • java.lang.Object
    • com.google.apphosting.api.ApiProxy

  • public class ApiProxy
    extends java.lang.Object
    ApiProxy is a static class that serves as the collection point for all API calls from user code into the application server. It is responsible for proxying makeSyncCall() calls to a delegate, which actually implements the API calls. It also stores an Environment for each thread, which contains additional user-visible information about the request.
    • Method Detail

      • makeSyncCall

        public static byte[] makeSyncCall(java.lang.String packageName,
                                          java.lang.String methodName,
                                          byte[] request,
                                          ApiProxy.ApiConfig apiConfig)
                                   throws ApiProxy.ApiProxyException
        Make a synchronous call to the specified method in the specified API package.

        Note: if you have not installed a Delegate and called setEnvironmentForCurrentThread in this thread before calling this method, it will act like no API calls are available (i.e. always throw CallNotFoundException).

        packageName - the name of the API package.
        methodName - the name of the method within the API package.
        request - a byte array containing the serialized form of the request protocol buffer.
        apiConfig - that specifies API-specific configuration parameters.
        a byte array containing the serialized form of the response protocol buffer.
        ApiProxy.ApplicationException - For any error that is the application's fault.
        ApiProxy.RPCFailedException - If we could not connect to a backend service.
        ApiProxy.CallNotFoundException - If the specified method does not exist, or if the thread making the call is neither a request thread nor a thread created by ThreadManager.
        ApiProxy.ArgumentException - If the request could not be parsed.