Helper class that simplifies Redis data access code.
Performs automatic serialization/deserialization between the given objects and the underlying binary data in the Redis store. By default, it uses Java serialization for its objects (through {@link JdkSerializationRedisSerializer}). For String intensive operations consider the dedicated {@link StringRedisTemplate}.
The central method is execute, supporting Redis access code implementing the {@link RedisCallback} interface. Itprovides {@link RedisConnection} handling such that neither the {@link RedisCallback} implementation nor the callingcode needs to explicitly care about retrieving/closing Redis connections, or handling Connection lifecycle exceptions. For typical single step actions, there are various convenience methods.
Once configured, this class is thread-safe.
Note that while the template is generified, it is up to the serializers/deserializers to properly convert the given Objects to and from binary data.
This is the central class in Redis support.
@author Costin Leau
@author Christoph Strobl
@param < K> the Redis key type against which the template works (usually a String)
@param < V> the Redis value type against which the template works
@see StringRedisTemplate