public class ApiProxyImpl extends Object implements com.google.apphosting.api.ApiProxy.Delegate<ApiProxyImpl.EnvironmentImpl>
It receives user-supplied API calls, translates them into the APIRequest arguments that APIHost expects, calls the asynchronous APIHost service, and translates any return value or error condition back into something that the user would expect.
| Modifier and Type | Class and Description |
|---|---|
static class |
ApiProxyImpl.Builder
Builder for ApiProxyImpl.Config.
|
static class |
ApiProxyImpl.EnvironmentImpl
To implement ApiProxy.Environment, we use a class that wraps
around an UPRequest and retrieves the necessary information from
it.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
BACKEND_ID_KEY |
static String |
CLOUD_SQL_JDBC_CONNECTIVITY_ENABLED_KEY |
static String |
INSTANCE_ID_KEY |
| Modifier and Type | Method and Description |
|---|---|
static ApiProxyImpl.Builder |
builder() |
ApiProxyImpl.EnvironmentImpl |
createEnvironment(AppVersion appVersion,
com.google.apphosting.base.protos.RuntimePb.UPRequest upRequest,
MutableUpResponse upResponse,
TraceWriter traceWriter,
CpuRatioTimer requestTimer,
String requestId,
List<Future<?>> asyncFutures,
Semaphore outstandingApiRpcSemaphore,
ThreadGroup requestThreadGroup,
RequestState requestState,
Long millisUntilSoftDeadline)
Creates an
ApiProxy.Environment instance that is suitable for use with this class. |
void |
flushLogs(ApiProxyImpl.EnvironmentImpl environment) |
List<Thread> |
getRequestThreads(ApiProxyImpl.EnvironmentImpl environment) |
void |
log(ApiProxyImpl.EnvironmentImpl environment,
com.google.apphosting.api.ApiProxy.LogRecord record) |
Future<byte[]> |
makeAsyncCall(ApiProxyImpl.EnvironmentImpl environment,
String packageName,
String methodName,
byte[] request,
com.google.apphosting.api.ApiProxy.ApiConfig apiConfig) |
byte[] |
makeSyncCall(ApiProxyImpl.EnvironmentImpl environment,
String packageName,
String methodName,
byte[] request) |
void |
setRequestManager(RequestManager requestManager) |
public static final String BACKEND_ID_KEY
public static final String INSTANCE_ID_KEY
public static final String CLOUD_SQL_JDBC_CONNECTIVITY_ENABLED_KEY
public static ApiProxyImpl.Builder builder()
public void setRequestManager(RequestManager requestManager)
public byte[] makeSyncCall(ApiProxyImpl.EnvironmentImpl environment, String packageName, String methodName, byte[] request)
makeSyncCall in interface com.google.apphosting.api.ApiProxy.Delegate<ApiProxyImpl.EnvironmentImpl>public Future<byte[]> makeAsyncCall(ApiProxyImpl.EnvironmentImpl environment, String packageName, String methodName, byte[] request, com.google.apphosting.api.ApiProxy.ApiConfig apiConfig)
makeAsyncCall in interface com.google.apphosting.api.ApiProxy.Delegate<ApiProxyImpl.EnvironmentImpl>public void log(ApiProxyImpl.EnvironmentImpl environment, com.google.apphosting.api.ApiProxy.LogRecord record)
log in interface com.google.apphosting.api.ApiProxy.Delegate<ApiProxyImpl.EnvironmentImpl>public void flushLogs(ApiProxyImpl.EnvironmentImpl environment)
flushLogs in interface com.google.apphosting.api.ApiProxy.Delegate<ApiProxyImpl.EnvironmentImpl>public List<Thread> getRequestThreads(ApiProxyImpl.EnvironmentImpl environment)
getRequestThreads in interface com.google.apphosting.api.ApiProxy.Delegate<ApiProxyImpl.EnvironmentImpl>public ApiProxyImpl.EnvironmentImpl createEnvironment(AppVersion appVersion, com.google.apphosting.base.protos.RuntimePb.UPRequest upRequest, MutableUpResponse upResponse, @Nullable TraceWriter traceWriter, CpuRatioTimer requestTimer, String requestId, List<Future<?>> asyncFutures, Semaphore outstandingApiRpcSemaphore, ThreadGroup requestThreadGroup, RequestState requestState, @Nullable Long millisUntilSoftDeadline)
ApiProxy.Environment instance that is suitable for use with this class.Copyright © 2022. All rights reserved.