com.googlecode.objectify.impl
Class SessionCachingAsyncObjectifyImpl

java.lang.Object
  extended by com.googlecode.objectify.impl.AsyncObjectifyImpl
      extended by com.googlecode.objectify.impl.SessionCachingAsyncObjectifyImpl
All Implemented Interfaces:
AsyncObjectify

public class SessionCachingAsyncObjectifyImpl
extends AsyncObjectifyImpl

Extends the AsyncObjectifyImpl to add a session cache. Note that it only needs to override a few key methods.

Author:
Jeff Schnitzer

Field Summary
protected  java.util.Map<Key<?>,java.lang.Object> cache
          The cache is a simple hashmap
protected static java.lang.Object NEGATIVE_RESULT
          Value which gets put in the cache for negative results
 
Fields inherited from class com.googlecode.objectify.impl.AsyncObjectifyImpl
ads, factory, sync, txn
 
Constructor Summary
SessionCachingAsyncObjectifyImpl(ObjectifyFactory fact, com.google.appengine.api.datastore.AsyncDatastoreService ds, com.google.appengine.api.datastore.Transaction txn)
           
 
Method Summary
 Result<java.lang.Void> delete(java.lang.Iterable<?> keysOrEntities)
           
<T> Result<java.util.Map<Key<T>,T>>
get(java.lang.Iterable<? extends Key<? extends T>> keys)
           
<T> Result<java.util.Map<Key<T>,T>>
put(java.lang.Iterable<? extends T> objs)
           
<T> Query<T>
query()
          Not currently part of the AsyncObjectify api, but the actual logic lives here.
<T> Query<T>
query(java.lang.Class<T> clazz)
          Not currently part of the AsyncObjectify api, but the actual logic lives here.
 
Methods inherited from class com.googlecode.objectify.impl.AsyncObjectifyImpl
delete, delete, delete, find, find, find, get, get, get, get, get, get, getAsyncDatastore, getFactory, getTxn, put, put, sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEGATIVE_RESULT

protected static final java.lang.Object NEGATIVE_RESULT
Value which gets put in the cache for negative results


cache

protected java.util.Map<Key<?>,java.lang.Object> cache
The cache is a simple hashmap

Constructor Detail

SessionCachingAsyncObjectifyImpl

public SessionCachingAsyncObjectifyImpl(ObjectifyFactory fact,
                                        com.google.appengine.api.datastore.AsyncDatastoreService ds,
                                        com.google.appengine.api.datastore.Transaction txn)
Method Detail

get

public <T> Result<java.util.Map<Key<T>,T>> get(java.lang.Iterable<? extends Key<? extends T>> keys)
Specified by:
get in interface AsyncObjectify
Overrides:
get in class AsyncObjectifyImpl
See Also:
Objectify.get(Iterable)

put

public <T> Result<java.util.Map<Key<T>,T>> put(java.lang.Iterable<? extends T> objs)
Specified by:
put in interface AsyncObjectify
Overrides:
put in class AsyncObjectifyImpl
See Also:
Objectify.put(Iterable)

delete

public Result<java.lang.Void> delete(java.lang.Iterable<?> keysOrEntities)
Specified by:
delete in interface AsyncObjectify
Overrides:
delete in class AsyncObjectifyImpl
See Also:
Objectify.delete(Iterable)

query

public <T> Query<T> query()
Description copied from class: AsyncObjectifyImpl
Not currently part of the AsyncObjectify api, but the actual logic lives here.

Overrides:
query in class AsyncObjectifyImpl

query

public <T> Query<T> query(java.lang.Class<T> clazz)
Description copied from class: AsyncObjectifyImpl
Not currently part of the AsyncObjectify api, but the actual logic lives here.

Overrides:
query in class AsyncObjectifyImpl


Copyright © 2011 Jeff Schnitzer and a gang of pirates. All Rights Reserved. Build version: 3.1