Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Appengine Java Night #2b

1,421 views

Published on

Published in: Technology
  • Be the first to comment

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@

×