1 // Copyright 2009 Google Inc. All Rights Reserved.
3 package com
.google
.appengine
.api
.memcache
.stdimpl
;
7 import javax
.cache
.Cache
;
8 import javax
.cache
.CacheFactory
;
11 * JCache CacheFactory implementation using Memcache.
14 public class GCacheFactory
implements CacheFactory
{
17 * Property key for expiration time in seconds set for all put operations as
20 public static final int EXPIRATION_DELTA
= 0;
23 * Property key for expiration time in milliseconds set for all put
24 * operations as an Integer.
26 public static final int EXPIRATION_DELTA_MILLIS
= 1;
29 * Property key for absolute expiration time for all put operations as a
32 public static final int EXPIRATION
= 2;
35 * Property key for put operation policy as a
36 * {@link com.google.appengine.api.memcache.MemcacheService.SetPolicy}.
37 * Defaults to {@link SetPolicy.SET_ALWAYS} if not specified.
39 public static final int SET_POLICY
= 3;
42 * Property key for memcache service to use as a
43 * {@link com.google.appengine.api.memcache.MemcacheService}. Defaults to
44 * that provided by {@link MemcacheServiceFactory.getMemcacheService} if not
47 public static final int MEMCACHE_SERVICE
= 4;
50 * Property key for defining a non-default namespace. This has the
51 * same effect setting a namespace using {@link
52 * com.google.appengine.api.memcache.MemcacheServiceFactory#getMemcacheService(String)}.
53 * This property is ignored if MEMCACHE_SERVICE property specified.
55 public static final int NAMESPACE
= 5;
58 * Creates a cache instance using the memcache service.
59 * @param map A map of properties.
62 public Cache
createCache(Map map
) {
63 return new GCache(map
);