How do I adapt Spymecached to net.sf.jsr107cache.Cache?

79 Views Asked by At

I need to write a new implementation against net.sf.jsr107cache.Cache using the Java net.spy.memcached package (for Redis Cloud Memcached). The package does not include an implementation this interface. I can of course write an adapter and implement Cache myself, but there are some differences in functionality

  • Object keys, not just String keys, in Cache but not in Spy
  • clear()
  • putAll()
  • size()

Given that both memcached and JSR-107 are standards -- there a standard way to adapt Spy to JSR-107?

1

There are 1 best solutions below

0
On

Answer:

  • Spymemcached is incompatible with JSR 107
  • Only String keys are possible.
  • clear() is implemented with flush()
  • putAll() may be implemented witha loop.
  • size() is not available.