Your SlideShare is downloading. ×
Appengine ja-night-sapporo#1 bt
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Appengine ja-night-sapporo#1 bt

880
views

Published on


0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
880
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. appengine ja night sapporo#1 AppEngine Lower shin1ogawa@
  • 2. Delegate
  • 3. 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); }
  • 4. 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); }
  • 5. 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);
  • 6. public byte[] makeSyncCall( Environment environment, String service, String method, byte[] request) throws ApiProxyException { return protocolBufferOnHttp( environment, service, method, request); } byte[] protocolBufferOnHttp(.....) { // makeSyncCallServlet Post // byte[] }
  • 7. shin1ogawa@

×