首页>代码>Spring Boot整合Hazelcast Caching的简单入门实例>/hazelcast/src/main/java/com/memorynotfound/springboot/Application.java
package com.memorynotfound.springboot; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; @EnableCaching @SpringBootApplication public class Application implements CommandLineRunner { private static Logger log = LoggerFactory.getLogger(Application.class); @Autowired private MusicService musicService; @Autowired private CacheManager cacheManager; public static void main(String[] args) throws Exception { SpringApplication.run(Application.class, args); } @Override public void run(String... args) throws Exception { log.info("Spring Boot Hazelcast Caching Example Configuration"); log.info("Using cache manager: " + cacheManager.getClass().getName()); musicService.clearCache(); play("zuidaima"); play("trombone"); play("guitar"); play("trombone"); play("zuidaima"); play("bass"); play("trombone"); play("zuidaima"); } private void play(String instrument) { log.info("Calling: " + MusicService.class.getSimpleName() + ".play(\"" + instrument + "\");"); musicService.play(instrument); } }

jaflkjlkfdjl LV6
2021年11月10日
最代码官方 LV168
2020年12月16日

哪里的完整版 LV8
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日