xieguoking / hibernate-memcached

Automatically exported from code.google.com/p/hibernate-memcached
0 stars 0 forks source link

it should be a way to get the cached from MemcachedCacheProvider by coding #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
it may be add a new property to MemcachedCacheProvider like below:
private Cache cache;

and in the method buildCached , add in last :

cache = new SpyMemcache(client);

and add a new static method;

public static Cache getCache(){
   return Cache ;
} 

so everybody can reuse the memcached client in coding for other uses .

Original issue reported on code.google.com by dingding...@gmail.com on 21 Aug 2008 at 6:03

GoogleCodeExporter commented 9 years ago
the way above is wrong
MemcacheClientFactory createMemcacheClient return the client may be use the 
single 
pattern

Original comment by dingding...@gmail.com on 21 Aug 2008 at 6:38

GoogleCodeExporter commented 9 years ago
You could implement your own MemcacheClientFactory or extend the
SpyMemcacheClientFactory to get the memcache client from wherever you'd like.

Original comment by raykrue...@gmail.com on 2 Sep 2008 at 1:05