public class RequestManager extends Object
RequestManager is responsible for setting up and tearing
down any state associated with each request.
At the moment, this includes:
Environment implementation for the
request's thread into ApiProxy.
RequestManager.RequestToken token =
requestManager.startRequest(...);
try {
...
} finally {
requestManager.finishRequest(token);
}
| Modifier and Type | Class and Description |
|---|---|
static class |
RequestManager.Builder
Builder for of a RequestManager instance.
|
class |
RequestManager.DeadlineRunnable
DeadlineRunnable causes the specified Throwable
to be thrown within the specified thread. |
static class |
RequestManager.RequestToken
RequestToken acts as a Memento object that passes state
between a call to startRequest and finishRequest. |
| Modifier and Type | Method and Description |
|---|---|
static RequestManager.Builder |
builder()
Make a partly-initialized builder for a RequestManager.
|
void |
disableCloudDebugger()
Disables Cloud Debugger.
|
void |
finishRequest(RequestManager.RequestToken requestToken)
Tear down any state associated with the specified request, and
restore the current thread's state as it was before
startRequest was called. |
void |
sendDeadline(RequestManager.RequestToken token,
boolean isUncatchable) |
void |
sendDeadline(String securityTicket,
boolean isUncatchable) |
void |
setMaxOutstandingApiRpcs(int maxOutstandingApiRpcs) |
void |
shutdownRequests(RequestManager.RequestToken token)
Notify requests that the server is shutting down.
|
RequestManager.RequestToken |
startRequest(AppVersion appVersion,
AnyRpcServerContext rpc,
com.google.apphosting.base.protos.RuntimePb.UPRequest upRequest,
MutableUpResponse upResponse,
ThreadGroup requestThreadGroup)
Set up any state necessary to execute a new request using the
specified parameters.
|
public static RequestManager.Builder builder()
public void setMaxOutstandingApiRpcs(int maxOutstandingApiRpcs)
public void disableCloudDebugger()
If called before the first request has been processed, the Cloud Debugger will not be even activated.
public RequestManager.RequestToken startRequest(AppVersion appVersion, AnyRpcServerContext rpc, com.google.apphosting.base.protos.RuntimePb.UPRequest upRequest, MutableUpResponse upResponse, ThreadGroup requestThreadGroup)
RequestToken that should be passed into finishRequest after the request completes.public void finishRequest(RequestManager.RequestToken requestToken)
startRequest was called.IllegalStateException - if called from the wrong thread.public void sendDeadline(String securityTicket, boolean isUncatchable)
public void sendDeadline(RequestManager.RequestToken token, boolean isUncatchable)
public void shutdownRequests(RequestManager.RequestToken token)
Copyright © 2022. All rights reserved.