Appengine Java Night #2 Lt

896 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
896
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Appengine Java Night #2 Lt

  1. 1. appengine java night #2 ProtocolBuffer on HTTP shin1ogawa@
  2. 2. ApiProxy#getDelegate() Application Stub LowLevelAPI PB ApiProxy PB #getDelegate()
  3. 3. Delegate#makeSyncCall() Service ,Method ,Request(byte[]) ApiProxy #getDelegate() #makeSyncCall() PB(byte[]) Stub/
  4. 4. Server … • ApiProxy.setDelegate( Delegate) ProtocolBuffer • ProtocolBuffer
  5. 5. • OreOreDelegate #makeSyncCall() Stub • ApiProxy.getDelegate().makeSyncCall() • OreOreDelegate Low-Level API • Low-Level API Application
  6. 6. ProtocolBuffer on HTTP Application LowLevelAPI PB PB OreOreServlet OreOreDelegate PB
  7. 7. MakeSyncCallServlet makeSyncCall() String serviceName = req.getHeader(SERVICE_NAME); String methodName = req.getHeader(METHOD_NAME); byte[] requestBytes = IOUtils.toByteArray(req.getInputStream()); byte[] responseBytes = ApiProxy.getDelegate().makeSyncCall( ApiProxy.getCurrentEnvironment(), serviceName, methodName, requestBytes); resp.getOutputStream().write(responseBytes);
  8. 8. MakeSyncCallDelegate MakeSyncCall public byte[] makeSyncCall( Environment environment, String serviceName, String methodName, byte[] request) throws ApiProxyException { return protocolBufferOnHttp( environment, serviceName, methodName, request); } byte[] protocolBufferOnHttp(.....) { // makeSyncCall Post byte[] }
  9. 9. • Datastore " Datastore • Datastore " Datastore • Memcache " Memcache
  10. 10. shin1ogawa@

×