All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.ibole.infrastructure.cache.redis.RedisCacheWrapper Maven / Gradle / Ivy

The newest version!
package com.github.ibole.infrastructure.cache.redis;

import com.github.ibole.infrastructure.cache.CacheWrapper;
import com.github.ibole.infrastructure.common.serialization.KryoSerializationUtil;

/*********************************************************************************************.
 * 
 * 
 * 

Copyright 2016, iBole Inc. All rights reserved. * *

*********************************************************************************************/ /** * @author bwang * */ public class RedisCacheWrapper implements CacheWrapper { private RedisSimpleTempalte redisTemplate; public RedisCacheWrapper(RedisSimpleTempalte redisTemplate) { this.redisTemplate = redisTemplate; } @Override public void put(K key, V value) { redisTemplate .setSafety(key.toString(), KryoSerializationUtil.getInstance().serialize(value), 0); } @Override public V get(K key) { return KryoSerializationUtil.getInstance().deserialize( redisTemplate.getSafetyByte(key.toString())); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy