Authored by hugufei

去除EhCache里的缓存使用日志提示

... ... @@ -6,8 +6,6 @@ import java.util.Map;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import com.yoho.search.cache.impl.EhCacheImpl;
... ... @@ -20,8 +18,6 @@ import com.yoho.search.utils.TimeUtils;
@Service
public class CacheService {
private final Logger logger = LoggerFactory.getLogger(CacheService.class);
public CacheInterface cacheInterface;
/**
... ... @@ -29,7 +25,6 @@ public class CacheService {
*/
@PostConstruct
public void init() {
logger.info("使用 本地缓存");
cacheInterface = EhCacheImpl.getInstance();
}
... ...
... ... @@ -103,6 +103,7 @@ public class EhCacheImpl implements CacheInterface {
add(key, value, expiration);
return true;
} catch (Exception e) {
logger.error(e.getMessage(),e);
return false;
}
}
... ... @@ -112,7 +113,7 @@ public class EhCacheImpl implements CacheInterface {
delete(key);
return true;
} catch (Exception e) {
logger.error(e.toString());
logger.error(e.getMessage(),e);
return false;
}
}
... ... @@ -122,7 +123,7 @@ public class EhCacheImpl implements CacheInterface {
replace(key, value, expiration);
return true;
} catch (Exception e) {
logger.error(e.toString());
logger.error(e.getMessage(),e);
return false;
}
}
... ... @@ -132,7 +133,7 @@ public class EhCacheImpl implements CacheInterface {
set(key, value, expiration);
return true;
} catch (Exception e) {
logger.error(e.toString());
logger.error(e.getMessage(),e);
return false;
}
}
... ... @@ -142,7 +143,7 @@ public class EhCacheImpl implements CacheInterface {
element.setTimeToLive(expiration);
cache.put(element);
}
public void stop() {
cacheManager.shutdown();
}
... ...
... ... @@ -23,7 +23,6 @@ public class CacheObject implements Serializable{
return expireTime;
}
public static void main(String[] args) {
long current = System.currentTimeMillis();
System.out.println(current);
... ...