Appengine Java Night #2b

1,257 views
1,205 views

Published on

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

No Downloads
Views
Total views
1,257
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
25
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Appengine Java Night #2b

  1. 1. appengine java night #2 α shin1ogawa@
  2. 2. AppEngine AppEngine ApiProxy#getDelegate() Delegate Web Delegate Web ApiProxy #getCurrentEnvironment() Environment (ApplicationID, versionID )
  3. 3. AppEngine JUnit SDK Web ApiProy • Environment ApiProxy#setEnvironmentForCurrentThread() • Delegate ApiProxyLocalImpl ApiProxy#setDelegate()
  4. 4. Environment • • ApplicationID, versionID, • Web SingleThread • ApiProxy#setEnvironmentForCurrentThread()
  5. 5. Delegate : ApiProxyLocalImpl • Delegate Delegate • • WEB-INF/queue.xml datastore-indexes.xml
  6. 6. Delegate • Delegate • … / • ApiProxy#getDelegate() AOP
  7. 7. Delegate class MyDelegate implements Delegate { Delegate original = ApiProxy.getDelegate(); public byte[] makeSyncCall( Environment environment, String service, String method, byte[] request) throws ApiProxyException { System.out.println(service+”:”+method); return original.makeSyncCall( environment, service, method, requst); } }
  8. 8. makeSyncCall() byte[] Delegate#makeSyncCall( Environment environment, String service, String method, byte[] request) throws ApiProxyException
  9. 9. makeSyncCall() byte[] Delegate#makeSyncCall( Environment environment, String service, String method, byte[] request) throws ApiProxyException
  10. 10. makeSyncCall() • datastore_v3#GET • : DatastorePb.GetRequest • new GetRequest().mergeFrom(byte[]) • GetRequest#keyIterator() Key Iterator • : DatastorePb.GetResponse • new GetResponse().mergeFrom(byte[]) • GetResponse#entityIterator() Entity Iterator
  11. 11. • Mail • MailService Delegate#makeSyncCall() Stub • makeSyncCall() byte[] MailServicePb.MailMessage MailMessage#getCC()... assert
  12. 12.
  13. 13. • … • datastore_v3#GET • memcache#GET datastore mamcache#GET • datastore_v3#PUT/DELETE • memcache#DELETE datastore
  14. 14. shin1ogawa@

×