More Related Content
Similar to Appengine ja-night-sapporo#1 bt
Similar to Appengine ja-night-sapporo#1 bt (20)
Appengine ja-night-sapporo#1 bt
- 5. final ApiProxy.Delegate defaultDelegate =
ApiProxy.getDelegate();
public byte[] makeSyncCall(
Environment environment, String service,
String method, byte[] request)
throws ApiProxyException {
System.out.println(service + “#” + method);
defaultDelegate.makeSyncCall(
serviceName, methodName, request);
}
- 7. public byte[] makeSyncCall(
Environment environment, String service,
String method, byte[] request)
throws ApiProxyException {
if (service.equals(“datastore_v3”)
&& method.equalsIgnoreCase(“Put”)
){
throw new CapabilityDisabledException();
}
defaultDelegate.makeSyncCall(
serviceName, methodName, request);
}
- 11. String service =
req.getHeader(SERVICE_NAME);
String method = req.getHeader(METHOD_NAME);
byte[] requestBytes =
IOUtils.toByteArray(req.getInputStream());
byte[] responseBytes =
ApiProxy.getDelegate().makeSyncCall(
ApiProxy.getCurrentEnvironment(),
service, method, requestBytes);
resp.getOutputStream().write(responseBytes);
- 12. public byte[] makeSyncCall(
Environment environment, String service,
String method, byte[] request)
throws ApiProxyException {
return protocolBufferOnHttp(
environment, service, method, request);
}
byte[] protocolBufferOnHttp(.....) {
// makeSyncCallServlet Post
// byte[]
}