Class MemcacheServiceFactory
java.lang.Object
com.google.appengine.api.memcache.MemcacheServiceFactory
The factory by which users acquire a handle to the MemcacheService.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AsyncMemcacheServiceSimilar togetMemcacheService()but returns a handle to an asynchronous version of the cache service.static AsyncMemcacheServicegetAsyncMemcacheService(String namespace) Similar togetMemcacheService(String)but returns a handle to an asynchronous version of the cache service.static MemcacheServiceGets a handle to the cache service.static MemcacheServicegetMemcacheService(String namespace) Gets a handle to the cache service, forcing use of specific namespace.
-
Method Details
-
getMemcacheService
Gets a handle to the cache service. Although there is only one actual cache, an application may make as manyMemcacheServiceinstances as it finds convenient.If using multiple instances, note that the error handler established with
BaseMemcacheService.setErrorHandler(ErrorHandler)is specific to each instance. All operations in theMemcacheServicewill use the current namespace provided byNamespaceManager.get().- Returns:
- a new
MemcacheServiceinstance.
-
getMemcacheService
Gets a handle to the cache service, forcing use of specific namespace. The method returnsMemcacheServicesimilar to the one returned bygetMemcacheService()but it will use specifiednamespacefor all operations.- Parameters:
namespace- if notnullforces the use ofnamespacefor all operations inMemcacheService. Ifnamespaceisnull- createdMemcacheServicewill use current namespace provided byNamespaceManager.get().- Returns:
- a new
MemcacheServiceinstance.
-
getAsyncMemcacheService
Similar togetMemcacheService()but returns a handle to an asynchronous version of the cache service. -
getAsyncMemcacheService
Similar togetMemcacheService(String)but returns a handle to an asynchronous version of the cache service.
-