Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / memcache / IMemcacheServiceFactory.java
blobe04802743601bdbf61195ac24c3f70513e82690f
1 // Copyright 2012 Google Inc. All rights reserved.
3 package com.google.appengine.api.memcache;
5 /**
6 * The factory by which users acquire a handle to the MemcacheService.
8 */
9 public interface IMemcacheServiceFactory {
10 /**
11 * Gets a handle to the cache service, forcing use of specific namespace.
13 * <p>Although there is only one actual cache, an application may make as many
14 * {@code MemcacheService} instances as it finds convenient. If using multiple instances, note
15 * that the error handler established with {@link MemcacheService#setErrorHandler(ErrorHandler)}
16 * is specific to each instance.
18 * @param namespace if not {@code null} forces the use of {@code namespace}
19 * for all operations in {@code MemcacheService} . If {@code namespace} is
20 * {@code null} - created {@code MemcacheService} will use current namespace
21 * provided by {@link com.google.appengine.api.NamespaceManager#get()}.
23 * @return a new {@code MemcacheService} instance.
25 MemcacheService getMemcacheService(String namespace);
27 /**
28 * Similar to {@link #getMemcacheService(String)} but returns a handle to an
29 * asynchronous version of the cache service.
31 AsyncMemcacheService getAsyncMemcacheService(String namespace);