Class CachingDatastoreServiceFactory

java.lang.Object
com.googlecode.objectify.cache.CachingDatastoreServiceFactory

public class CachingDatastoreServiceFactory
extends Object

A convenience class with factory methods to create caching versions of DatastoreService and AsyncDatastoreService. These are just shortcuts for common cases - do not be afraid to use the constructors of CachingDatastoreService or CachingAsyncDatastoreService to create an interface tailored exactly to your caching needs.

Author:
Jeff Schnitzer
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.google.appengine.api.datastore.AsyncDatastoreService
    Get a caching AsyncDatastoreService with no pre-set expiration on cache values.
    static com.google.appengine.api.datastore.AsyncDatastoreService
    getAsyncDatastoreService​(int expirySeconds)
    Get a caching AsyncDatastoreService with a specific expiration on all cached items.
    static com.google.appengine.api.datastore.AsyncDatastoreService
    getAsyncDatastoreService​(com.google.appengine.api.datastore.DatastoreServiceConfig cfg)
    Get a caching AsyncDatastoreService with no pre-set expiration on cache values.
    static com.google.appengine.api.datastore.AsyncDatastoreService
    getAsyncDatastoreService​(com.google.appengine.api.datastore.DatastoreServiceConfig cfg, int expirySeconds)
    Get a caching AsyncDatastoreService with a specific expiration on all cached items.
    getAsyncDatastoreService​(com.google.appengine.api.datastore.DatastoreServiceConfig cfg, EntityMemcache em)
    Get a caching AsyncDatastoreService that uses a particular EntityMemcache configuration.
    Get a caching AsyncDatastoreService that uses a particular EntityMemcache configuration.
    static com.google.appengine.api.datastore.DatastoreService
    Get a caching DatastoreService with no pre-set expiration on cache values.
    static com.google.appengine.api.datastore.DatastoreService
    getDatastoreService​(int expirySeconds)
    Get a caching DatastoreService with a specific expiration on all cached items.
    static com.google.appengine.api.datastore.DatastoreService
    getDatastoreService​(com.google.appengine.api.datastore.DatastoreServiceConfig cfg)
    Get a caching DatastoreService with no pre-set expiration on cache values.
    static com.google.appengine.api.datastore.DatastoreService
    getDatastoreService​(com.google.appengine.api.datastore.DatastoreServiceConfig cfg, int expirySeconds)
    Get a caching DatastoreService with a specific expiration on all cached items.
    getDatastoreService​(com.google.appengine.api.datastore.DatastoreServiceConfig cfg, EntityMemcache em)
    Get a caching DatastoreService that uses a particular EntityMemcache configuration.
    Get a caching DatastoreService that uses a particular EntityMemcache configuration.
    static String
    The memcache snamespace used by default for most of these factory methods
    static void
    The default namespace is the one used by Objectify for its cache.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • setDefaultMemcacheNamespace

      public static void setDefaultMemcacheNamespace(String value)
      The default namespace is the one used by Objectify for its cache. You can reset it.
    • getDefaultMemcacheNamespace

      public static String getDefaultMemcacheNamespace()
      The memcache snamespace used by default for most of these factory methods
    • getDatastoreService

      public static com.google.appengine.api.datastore.DatastoreService getDatastoreService()
      Get a caching DatastoreService with no pre-set expiration on cache values.
    • getDatastoreService

      public static com.google.appengine.api.datastore.DatastoreService getDatastoreService(com.google.appengine.api.datastore.DatastoreServiceConfig cfg)
      Get a caching DatastoreService with no pre-set expiration on cache values.
    • getAsyncDatastoreService

      public static com.google.appengine.api.datastore.AsyncDatastoreService getAsyncDatastoreService()
      Get a caching AsyncDatastoreService with no pre-set expiration on cache values.
    • getAsyncDatastoreService

      public static com.google.appengine.api.datastore.AsyncDatastoreService getAsyncDatastoreService(com.google.appengine.api.datastore.DatastoreServiceConfig cfg)
      Get a caching AsyncDatastoreService with no pre-set expiration on cache values.
    • getDatastoreService

      public static com.google.appengine.api.datastore.DatastoreService getDatastoreService(int expirySeconds)
      Get a caching DatastoreService with a specific expiration on all cached items.
    • getDatastoreService

      public static com.google.appengine.api.datastore.DatastoreService getDatastoreService(com.google.appengine.api.datastore.DatastoreServiceConfig cfg, int expirySeconds)
      Get a caching DatastoreService with a specific expiration on all cached items.
    • getAsyncDatastoreService

      public static com.google.appengine.api.datastore.AsyncDatastoreService getAsyncDatastoreService(int expirySeconds)
      Get a caching AsyncDatastoreService with a specific expiration on all cached items.
    • getAsyncDatastoreService

      public static com.google.appengine.api.datastore.AsyncDatastoreService getAsyncDatastoreService(com.google.appengine.api.datastore.DatastoreServiceConfig cfg, int expirySeconds)
      Get a caching AsyncDatastoreService with a specific expiration on all cached items.
    • getDatastoreService

      public static CachingDatastoreService getDatastoreService(EntityMemcache em)
      Get a caching DatastoreService that uses a particular EntityMemcache configuration. Ignores the default memcacheService for this factory; that is set when you construct your EntityMemcache.
    • getAsyncDatastoreService

      public static CachingAsyncDatastoreService getAsyncDatastoreService(EntityMemcache em)
      Get a caching AsyncDatastoreService that uses a particular EntityMemcache configuration. Ignores the default memcacheService for this factory; that is set when you construct your EntityMemcache.
    • getDatastoreService

      public static CachingDatastoreService getDatastoreService(com.google.appengine.api.datastore.DatastoreServiceConfig cfg, EntityMemcache em)
      Get a caching DatastoreService that uses a particular EntityMemcache configuration. Ignores the default memcacheService for this factory; that is set when you construct your EntityMemcache.
    • getAsyncDatastoreService

      public static CachingAsyncDatastoreService getAsyncDatastoreService(com.google.appengine.api.datastore.DatastoreServiceConfig cfg, EntityMemcache em)
      Get a caching AsyncDatastoreService that uses a particular EntityMemcache configuration. Ignores the default memcacheService for this factory; that is set when you construct your EntityMemcache.