首页>代码>Spring Boot整合Hazelcast Caching的简单入门实例>/hazelcast/src/main/java/com/memorynotfound/springboot/MusicService.java
package com.memorynotfound.springboot;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.*;
import org.springframework.stereotype.Service;

@Service
@CacheConfig(cacheNames = "instruments")
public class MusicService {

    private static Logger log = LoggerFactory.getLogger(MusicService.class);

    @CacheEvict(allEntries = true)
    public void clearCache(){}

    @Cacheable(condition = "#instrument.equals('zuidaima')")
    public String play(String instrument) {
        log.info("Executing: " + this.getClass().getSimpleName() + ".play(\"" + instrument + "\");");
        return "paying " + instrument + "!";
    }

}
最近下载更多
jaflkjlkfdjl  LV6 2021年11月10日
最代码官方  LV167 2020年12月16日
最近浏览更多
哪里的完整版  LV7 2023年12月15日
花无拆  LV2 2022年6月8日
www2222  LV2 2022年4月21日
1214066599  LV8 2022年4月7日
wxh1234567  LV4 2022年1月17日
jaflkjlkfdjl  LV6 2021年11月10日
小王wang  LV10 2021年3月1日
AA20012001AA 2021年1月3日
暂无贡献等级
houshuaitao  LV8 2020年12月30日
我寄愁心  LV8 2020年12月24日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友