最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Spring Boot集成Redis實現(xiàn)緩存機制(從零開始學(xué)Spring Boot)

 更新時間:2017年04月01日 12:02:57   作者:AndyLizh  
這篇文章主要介紹了Spring Boot集成Redis實現(xiàn)緩存機制(從零開始學(xué)Spring Boot),需要的朋友可以參考下

本文章牽涉到的技術(shù)點比較多:spring Data JPA、Redis、Spring MVC,Spirng Cache,所以在看這篇文章的時候,需要對以上這些技術(shù)點有一定的了解或者也可以先看看這篇文章,針對文章中實際的技術(shù)點在進一步了解(注意,您需要自己下載Redis Server到您的本地,所以確保您本地的Redis可用,這里還使用了MySQL數(shù)據(jù)庫,當(dāng)然你也可以內(nèi)存數(shù)據(jù)庫進行測試)。這篇文章會提供對應(yīng)的Eclipse代碼示例,具體大體的分如下幾個步驟:

(1)新建Java Maven Project;
(2)在pom.xml中添加相應(yīng)的依賴包;
(3)編寫Spring Boot啟動類;
(4)配置application.properties;
(5)編寫RedisCacheConfig配置類;
(6)編寫DemoInfo測試實體類;
(7)編寫DemoInfoRepository持久化類;
(8)編寫DemoInfoService類;
(9)編寫DemoInfoController類;
(10)測試代碼是否正常運行了
(11)自定義緩存key;

(1)新建Java Maven Project;

       這個步驟就不細說,新建一個spring-boot-redis Java maven project;

(2)在pom.xml中添加相應(yīng)的依賴包;

在Maven中添加相應(yīng)的依賴包,主要有:spring boot 父節(jié)點依賴;spring boot web支持;緩存服務(wù)spring-context-support;添加redis支持;JPA操作數(shù)據(jù)庫;mysql 數(shù)據(jù)庫驅(qū)動,具體pom.xml文件如下:

<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.kfit</groupId>
 <artifactId>spring-boot-redis</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <packaging>jar</packaging>
 <name>spring-boot-redis</name>
 <url>http://maven.apache.org</url>
 <properties>
 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 <!-- 配置JDK編譯版本. -->
 <java.version>1.8</java.version>
 </properties>
 <!-- spring boot 父節(jié)點依賴,
  引入這個之后相關(guān)的引入就不需要添加version配置,
  spring boot會自動選擇最合適的版本進行添加。
 -->
 <parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>1.3.3.RELEASE</version>
 </parent>
 <dependencies>
  <dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <scope>test</scope>
  </dependency>
  <!-- spring boot web支持:mvc,aop... -->
  <dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
  </dependency>
  <!--
   包含支持UI模版(Velocity,F(xiàn)reeMarker,JasperReports),
   郵件服務(wù),
   腳本服務(wù)(JRuby),
   緩存Cache(EHCache),
   任務(wù)計劃Scheduling(uartz)。
  -->
  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-context-support</artifactId>
  </dependency>
  <!-- 添加redis支持-->
  <dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-redis</artifactId>
  </dependency>
  <!-- JPA操作數(shù)據(jù)庫. -->
  <dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-data-jpa</artifactId>
  </dependency>
  <!-- mysql 數(shù)據(jù)庫驅(qū)動. -->
  <dependency>
   <groupId>mysql</groupId>
   <artifactId>mysql-connector-java</artifactId>
  </dependency>
  <!-- 單元測試. -->
  <dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-test</artifactId>
   <scope>test</scope>
  </dependency>
 </dependencies>
</project>

上面是完整的pom.xml文件,每個里面都進行了簡單的注釋。

(3)編寫Spring Boot啟動類(com.kfit.App);

package com.kfit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
 * Spring Boot啟動類;
 *
 * @author Angel(QQ:412887952)
 * @version v.0.1
 */
@SpringBootApplication
public class App {
  /**
  * -javaagent:.\lib\springloaded-1.2.4.RELEASE.jar -noverify
  * @param args
  */
  public static void main(String[] args) {
    SpringApplication.run(App.class, args);
  }
}

(4)配置application.properties;

這里主要是配置兩個資源,第一就是數(shù)據(jù)庫基本信息;第二就是redis配置;第三就是JPA的配置;

Src/main/resouces/application.properties:
########################################################
###datasource 配置MySQL數(shù)據(jù)源;
########################################################
spring.datasource.url = jdbc:mysql://localhost:3306/test
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.max-active=20
spring.datasource.max-idle=8
spring.datasource.min-idle=8
spring.datasource.initial-size=10
########################################################
###REDIS (RedisProperties) redis基本配置;
########################################################
# database name
spring.redis.database=0
# server host1
spring.redis.host=127.0.0.1 
# server password
#spring.redis.password=
#connection port
spring.redis.port=6379
# pool settings ...
spring.redis.pool.max-idle=8
spring.redis.pool.min-idle=0
spring.redis.pool.max-active=8
spring.redis.pool.max-wait=-1
# name of Redis server
#spring.redis.sentinel.master=
# comma-separated list of host:port pairs
#spring.redis.sentinel.nodes=
########################################################
### Java Persistence Api 自動進行建表
########################################################
# Specify the DBMS
spring.jpa.database = MYSQL
# Show or not log for each sql query
spring.jpa.show-sql = true
# hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update
# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
# stripped before adding them to the entity manager)
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

(5)編寫RedisCacheConfig配置類;

       緩存主要有幾個要實現(xiàn)的類:其一就是CacheManager緩存管理器;其二就是具體操作實現(xiàn)類;其三就是CacheManager工廠類(這個可以使用配置文件配置的進行注入,也可以通過編碼的方式進行實現(xiàn));其四就是緩存key生產(chǎn)策略(當(dāng)然Spring自帶生成策略,但是在Redis客戶端進行查看的話是系列化的key,對于我們?nèi)庋蹃碚f就是感覺是亂碼了,這里我們先使用自帶的緩存策略)。

com.kfit.config/RedisCacheConfig:
package com.kfit.config;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
/**
 * redis 緩存配置;
 *
 * 注意:RedisCacheConfig這里也可以不用繼承:CachingConfigurerSupport,也就是直接一個普通的Class就好了;
 *
 * 這里主要我們之后要重新實現(xiàn) key的生成策略,只要這里修改KeyGenerator,其它位置不用修改就生效了。
 *
 * 普通使用普通類的方式的話,那么在使用@Cacheable的時候還需要指定KeyGenerator的名稱;這樣編碼的時候比較麻煩。
 *
 * @author Angel(QQ:412887952)
 * @version v.0.1
 */
@Configuration
@EnableCaching//啟用緩存,這個注解很重要;
publicclass RedisCacheConfig extends CachingConfigurerSupport {
 /**
  * 緩存管理器.
  * @param redisTemplate
  * @return
  */
 @Bean
 public CacheManager cacheManager(RedisTemplate<?,?> redisTemplate) {
  CacheManager cacheManager = new RedisCacheManager(redisTemplate);
  returncacheManager;
 }
 /**
  * redis模板操作類,類似于jdbcTemplate的一個類;
  *
  * 雖然CacheManager也能獲取到Cache對象,但是操作起來沒有那么靈活;
  *
  * 這里在擴展下:RedisTemplate這個類不見得很好操作,我們可以在進行擴展一個我們
  *
  * 自己的緩存類,比如:RedisStorage類;
  *
  * @param factory : 通過Spring進行注入,參數(shù)在application.properties進行配置;
  * @return
  */
 @Bean
 public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory factory) {
  RedisTemplate<String, String> redisTemplate = new RedisTemplate<String, String>();
  redisTemplate.setConnectionFactory(factory);
  //key序列化方式;(不然會出現(xiàn)亂碼;),但是如果方法上有Long等非String類型的話,會報類型轉(zhuǎn)換錯誤;
  //所以在沒有自己定義key生成策略的時候,以下這個代碼建議不要這么寫,可以不配置或者自己實現(xiàn)ObjectRedisSerializer
  //或者JdkSerializationRedisSerializer序列化方式;
//  RedisSerializer<String> redisSerializer = new StringRedisSerializer();//Long類型不可以會出現(xiàn)異常信息;
//  redisTemplate.setKeySerializer(redisSerializer);
//  redisTemplate.setHashKeySerializer(redisSerializer);
  returnredisTemplate;
 }
}

在以上代碼有很詳細的注釋,在這里還是在簡單的提下:

RedisCacheConfig這里也可以不用繼承:CachingConfigurerSupport,也就是直接一個普通的Class就好了;這里主要我們之后要重新實現(xiàn) key的生成策略,只要這里修改KeyGenerator,其它位置不用修改就生效了。普通使用普通類的方式的話,那么在使用@Cacheable的時候還需要指定KeyGenerator的名稱;這樣編碼的時候比較麻煩。 

(6)編寫DemoInfo測試實體類;

       編寫一個測試實體類:com.kfit.bean.DemoInfo:

package com.kfit.bean;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
 * 測試實體類,這個隨便;
 * @author Angel(QQ:412887952)
 * @version v.0.1
 */
@Entity
publicclass DemoInfo implements Serializable{
 privatestaticfinallongserialVersionUID = 1L;
 @Id@GeneratedValue
 privatelongid;
 private String name;
 private String pwd;
 publiclong getId() {
  returnid;
 }
 publicvoid setId(longid) {
  this.id = id;
 }
 public String getName() {
  returnname;
 }
 publicvoid setName(String name) {
  this.name = name;
 }
 public String getPwd() {
  returnpwd;
 }
 publicvoid setPwd(String pwd) {
  this.pwd = pwd;
 }
 @Override
 public String toString() {
  return"DemoInfo [id=" + id + ", name=" + name + ", pwd=" + pwd + "]";
 }
}

(7)編寫DemoInfoRepository持久化類;

       DemoInfoRepository使用Spirng Data JPA實現(xiàn):

com.kfit.repository.DemoInfoRepository:
package com.kfit.repository;
import org.springframework.data.repository.CrudRepository;
import com.kfit.bean.DemoInfo;
/**
 * DemoInfo持久化類
 * @author Angel(QQ:412887952)
 * @version v.0.1
 */
publicinterface DemoInfoRepository extends CrudRepository<DemoInfo,Long> {
}

(8)編寫DemoInfoService類;

       編寫DemoInfoService,這里有兩個技術(shù)方面,第一就是使用Spring @Cacheable注解方式和RedisTemplate對象進行操作,具體代碼如下:

com.kfit.service.DemoInfoService:

package com.kfit.service;
import com.kfit.bean.DemoInfo;
/**
 * demoInfo 服務(wù)接口
 * @author Angel(QQ:412887952)
 * @version v.0.1
 */
publicinterface DemoInfoService {
 public DemoInfo findById(longid);
 publicvoid deleteFromCache(longid);
 void test();
}
com.kfit.service.impl.DemoInfoServiceImpl:
package com.kfit.service.impl;
import javax.annotation.Resource;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import com.kfit.bean.DemoInfo;
import com.kfit.repository.DemoInfoRepository;
import com.kfit.service.DemoInfoService;
/**
 *
 *DemoInfo數(shù)據(jù)處理類
 *
 * @author Angel(QQ:412887952)
 * @version v.0.1
 */
@Service
publicclass DemoInfoServiceImpl implements DemoInfoService {
 @Resource
 private DemoInfoRepository demoInfoRepository;
 @Resource
 private RedisTemplate<String,String> redisTemplate;
 @Override
 publicvoid test(){
  ValueOperations<String,String> valueOperations = redisTemplate.opsForValue();
  valueOperations.set("mykey4", "random1="+Math.random());
  System.out.println(valueOperations.get("mykey4"));
 }
 //keyGenerator="myKeyGenerator"
 @Cacheable(value="demoInfo") //緩存,這里沒有指定key.
 @Override
 public DemoInfo findById(longid) {
  System.err.println("DemoInfoServiceImpl.findById()=========從數(shù)據(jù)庫中進行獲取的....id="+id);
  returndemoInfoRepository.findOne(id);
 }
 @CacheEvict(value="demoInfo")
 @Override
 publicvoid deleteFromCache(longid) {
  System.out.println("DemoInfoServiceImpl.delete().從緩存中刪除.");
 }
}

(9)編寫DemoInfoController類;

package com.kfit.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.kfit.bean.DemoInfo;
import com.kfit.service.DemoInfoService;
/**
 * 測試類.
 * @author Angel(QQ:412887952)
 * @version v.0.1
 */
@Controller
publicclass DemoInfoController {
 @Autowired
  DemoInfoService demoInfoService;
 @RequestMapping("/test")
 public@ResponseBody String test(){
  DemoInfo loaded = demoInfoService.findById(1);
System.out.println("loaded="+loaded);
DemoInfo cached = demoInfoService.findById(1);
  System.out.println("cached="+cached);
  loaded = demoInfoService.findById(2);
  System.out.println("loaded2="+loaded);
  return"ok";
 }
 @RequestMapping("/delete")
 public@ResponseBody String delete(longid){
  demoInfoService.deleteFromCache(id);
  return"ok";
 }
 @RequestMapping("/test1")
 public@ResponseBody String test1(){
  demoInfoService.test();
  System.out.println("DemoInfoController.test1()");
  return"ok";
 }
}

(10)測試代碼是否正常運行了

啟動應(yīng)用程序,訪問地址:http://127.0.0.1:8080/test

查看控制臺可以查看:

DemoInfoServiceImpl.findById()=========從數(shù)據(jù)庫中進行獲取的....id=1
loaded=DemoInfo [id=1, name=張三, pwd=123456]
cached=DemoInfo [id=1, name=張三, pwd=123456]
DemoInfoServiceImpl.findById()=========從數(shù)據(jù)庫中進行獲取的....id=2
loaded2=DemoInfo [id=2, name=張三, pwd=123456]

如果你看到以上的打印信息的話,那么說明緩存成功了。

訪問地址:http://127.0.0.1:8080/test1

random1=0.9985031320746356
DemoInfoController.test1()

二次訪問:http://127.0.0.1:8080/test

loaded=DemoInfo [id=1, name=張三, pwd=123456]
cached=DemoInfo [id=1, name=張三, pwd=123456]
loaded2=DemoInfo [id=2, name=張三, pwd=123456]

這時候所有的數(shù)據(jù)都是執(zhí)行緩存的。

這時候執(zhí)行刪除動作:http://127.0.0.1:8080/delete?id=1

然后在訪問:http://127.0.0.1:8080/test

DemoInfoServiceImpl.findById()=========從數(shù)據(jù)庫中進行獲取的....id=1
loaded=DemoInfo [id=1, name=張三, pwd=123456]
cached=DemoInfo [id=1, name=張三, pwd=123456]
loaded2=DemoInfo [id=2, name=張三, pwd=123456]

(11)自定義緩存key;

在com.kfit.config.RedisCacheConfig類中重寫CachingConfigurerSupport中的keyGenerator ,具體實現(xiàn)代碼如下:

/**
  * 自定義key.
  * 此方法將會根據(jù)類名+方法名+所有參數(shù)的值生成唯一的一個key,即使@Cacheable中的value屬性一樣,key也會不一樣。
  */
 @Override
 public KeyGenerator keyGenerator() {
  System.out.println("RedisCacheConfig.keyGenerator()");
  returnnew KeyGenerator() {
   @Override
   public Object generate(Object o, Method method, Object... objects) {
    // This will generate a unique key of the class name, the method name
    //and all method parameters appended.
    StringBuilder sb = new StringBuilder();
    sb.append(o.getClass().getName());
    sb.append(method.getName());
    for (Object obj : objects) {
     sb.append(obj.toString());
    }
    System.out.println("keyGenerator=" + sb.toString());
    returnsb.toString();
   }
  };
 }

 這時候在redis的客戶端查看key的話還是序列化的肉眼看到就是亂碼了,那么我改變key的序列方式,這個很簡單,redis底層已經(jīng)有具體的實現(xiàn)類了,我們只需要配置下:

//key序列化方式;(不然會出現(xiàn)亂碼;),但是如果方法上有Long等非String類型的話,會報類型轉(zhuǎn)換錯誤;
//所以在沒有自己定義key生成策略的時候,以下這個代碼建議不要這么寫,可以不配置或者自己實現(xiàn)ObjectRedisSerializer
//或者JdkSerializationRedisSerializer序列化方式;
    RedisSerializer<String> redisSerializer = new StringRedisSerializer();//Long類型不可以會出現(xiàn)異常信息;
    redisTemplate.setKeySerializer(redisSerializer);
    redisTemplate.setHashKeySerializer(redisSerializer);

綜上以上分析:RedisCacheConfig類的方法調(diào)整為:

package com.kfit.config;
import java.lang.reflect.Method;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
 * redis 緩存配置;
 *
 * 注意:RedisCacheConfig這里也可以不用繼承:CachingConfigurerSupport,也就是直接一個普通的Class就好了;
 *
 * 這里主要我們之后要重新實現(xiàn) key的生成策略,只要這里修改KeyGenerator,其它位置不用修改就生效了。
 *
 * 普通使用普通類的方式的話,那么在使用@Cacheable的時候還需要指定KeyGenerator的名稱;這樣編碼的時候比較麻煩。
 *
 * @author Angel(QQ:412887952)
 * @version v.0.1
 */
@Configuration
@EnableCaching//啟用緩存,這個注解很重要;
publicclass RedisCacheConfig extends CachingConfigurerSupport {
  /**
   * 緩存管理器.
   * @param redisTemplate
   * @return
   */
  @Bean
  public CacheManager cacheManager(RedisTemplate<?,?> redisTemplate) {
    CacheManager cacheManager = new RedisCacheManager(redisTemplate);
    returncacheManager;
  }
  /**
   * RedisTemplate緩存操作類,類似于jdbcTemplate的一個類;
   *
   * 雖然CacheManager也能獲取到Cache對象,但是操作起來沒有那么靈活;
   *
   * 這里在擴展下:RedisTemplate這個類不見得很好操作,我們可以在進行擴展一個我們
   *
   * 自己的緩存類,比如:RedisStorage類;
   *
   * @param factory : 通過Spring進行注入,參數(shù)在application.properties進行配置;
   * @return
   */
  @Bean
  public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory factory) {
    RedisTemplate<String, String> redisTemplate = new RedisTemplate<String, String>();
    redisTemplate.setConnectionFactory(factory);
    //key序列化方式;(不然會出現(xiàn)亂碼;),但是如果方法上有Long等非String類型的話,會報類型轉(zhuǎn)換錯誤;
    //所以在沒有自己定義key生成策略的時候,以下這個代碼建議不要這么寫,可以不配置或者自己實現(xiàn)ObjectRedisSerializer
    //或者JdkSerializationRedisSerializer序列化方式;
    RedisSerializer<String> redisSerializer = new StringRedisSerializer();//Long類型不可以會出現(xiàn)異常信息;
    redisTemplate.setKeySerializer(redisSerializer);
    redisTemplate.setHashKeySerializer(redisSerializer);
    returnredisTemplate;
  }
  /**
   * 自定義key.
   * 此方法將會根據(jù)類名+方法名+所有參數(shù)的值生成唯一的一個key,即使@Cacheable中的value屬性一樣,key也會不一樣。
   */
  @Override
  public KeyGenerator keyGenerator() {
    System.out.println("RedisCacheConfig.keyGenerator()");
    returnnew KeyGenerator() {
      @Override
      public Object generate(Object o, Method method, Object... objects) {
       // This will generate a unique key of the class name, the method name
       //and all method parameters appended.
       StringBuilder sb = new StringBuilder();
       sb.append(o.getClass().getName());
       sb.append(method.getName());
       for (Object obj : objects) {
         sb.append(obj.toString());
       }
       System.out.println("keyGenerator=" + sb.toString());
       returnsb.toString();
      }
    };
  }
}

這時候在訪問地址:http://127.0.0.1:8080/test

這時候看到的Key就是:com.kfit.service.impl.DemoInfoServiceImplfindById1

在控制臺打印信息是:

(1)keyGenerator=com.kfit.service.impl.DemoInfoServiceImplfindById1
(2)DemoInfoServiceImpl.findById()=========從數(shù)據(jù)庫中進行獲取的....id=1
(3)keyGenerator=com.kfit.service.impl.DemoInfoServiceImplfindById1
(4)loaded=DemoInfo [id=1, name=張三, pwd=123456]
(5)keyGenerator=com.kfit.service.impl.DemoInfoServiceImplfindById1
(6)cached=DemoInfo [id=1, name=張三, pwd=123456]
(7)keyGenerator=com.kfit.service.impl.DemoInfoServiceImplfindById2
(8)keyGenerator=com.kfit.service.impl.DemoInfoServiceImplfindById2
(10)DemoInfoServiceImpl.findById()=========從數(shù)據(jù)庫中進行獲取的....id=2
(11)loaded2=DemoInfo [id=2, name=張三, pwd=123456]

其中@Cacheable,@CacheEvict下節(jié)進行簡單的介紹,這節(jié)的東西實在是太多了,到這里就打住吧,剩下的就需要靠你們自己進行擴展了。

以上所述是小編給大家介紹的Spring Boot集成Redis實現(xiàn)緩存機制(從零開始學(xué)Spring Boot),希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

  • MapTask工作機制圖文詳解

    MapTask工作機制圖文詳解

    今天小編就為大家分享一篇關(guān)于MapTask工作機制圖文詳解,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧
    2019-01-01
  • Java實現(xiàn)連連看算法

    Java實現(xiàn)連連看算法

    這篇文章主要為大家詳細介紹了Java實現(xiàn)連連看算法,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-06-06
  • Spring?Cloud?Loadbalancer服務(wù)均衡負載器詳解

    Spring?Cloud?Loadbalancer服務(wù)均衡負載器詳解

    這篇文章主要介紹了Spring?Cloud?Loadbalancer服務(wù)均衡負載器,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2025-03-03
  • Java 讀取指定路徑的文本文件并返回String的方法

    Java 讀取指定路徑的文本文件并返回String的方法

    今天小編就為大家分享一篇Java 讀取指定路徑的文本文件并返回String的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-07-07
  • 淺談java中unmodifiableList方法的應(yīng)用場景

    淺談java中unmodifiableList方法的應(yīng)用場景

    下面小編就為大家?guī)硪黄獪\談java中unmodifiableList方法的應(yīng)用場景。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-06-06
  • java中aop實現(xiàn)接口訪問頻率限制

    java中aop實現(xiàn)接口訪問頻率限制

    本文主要介紹了java中aop實現(xiàn)接口訪問頻率限制,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-04-04
  • 使用Spring Boot的LoggersEndpoint管理日志級別

    使用Spring Boot的LoggersEndpoint管理日志級別

    這篇文章主要為大家介紹了使用Spring Boot的LoggersEndpoint管理日志級別,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-11-11
  • Spring定時任務(wù)@scheduled多線程使用@Async注解示例

    Spring定時任務(wù)@scheduled多線程使用@Async注解示例

    這篇文章主要為大家介紹了Spring定時任務(wù)@scheduled多線程使用@Async注解示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-11-11
  • Java面試題沖刺第二十八天--數(shù)據(jù)庫(5)

    Java面試題沖刺第二十八天--數(shù)據(jù)庫(5)

    這篇文章主要為大家分享了最有價值的三道關(guān)于數(shù)據(jù)庫的面試題,涵蓋內(nèi)容全面,包括數(shù)據(jù)結(jié)構(gòu)和算法相關(guān)的題目、經(jīng)典面試編程題等,感興趣的小伙伴們可以參考一下
    2021-09-09
  • 帶你一文深入認識Java?String類

    帶你一文深入認識Java?String類

    這篇文章主要介紹了帶你一文深入認識Java?String類,String 類在Java中是很常用的類,很重要的類,在后續(xù)的學(xué)習(xí)中經(jīng)常會用到,是后續(xù)學(xué)習(xí)的基礎(chǔ), 文章圍繞主題展開更多詳細內(nèi)容,需要的小伙伴可以參考一下,希望對你的學(xué)習(xí)有所幫助
    2022-06-06

最新評論

饶平县| 温宿县| 绩溪县| 江山市| 昌都县| 信宜市| 柳州市| 淳化县| 镇平县| 民县| 安陆市| 喀喇沁旗| 平泉县| 夏津县| 凭祥市| 依兰县| 柳河县| 石狮市| 榆中县| 卫辉市| 永福县| 泽普县| 濉溪县| 新邵县| 江都市| 漳州市| 霍林郭勒市| 邹城市| 炉霍县| 云浮市| 光泽县| 庆阳市| 麻江县| 郁南县| 合肥市| 芦溪县| 元江| 合作市| 保靖县| 龙泉市| 祥云县|