SpringBook thread pool configuration and asynchronous task invocation

Way 1: Rewrite spring's default thread pool 1. Configuration of related parameters #Thread-related configuration #Number of core threads task.pool.corePoolSize: 5 #Maximum number of threads in thread pool task.pool.maxPoolSize: 20 #Maximum idle time of threads task.pool.keepAliveSeconds: 300 #Maxim ...

Added by g00bster on Sat, 05 Oct 2019 11:16:46 +0300

Custom Display Lock

Background: ** In multithreaded programming, in order to avoid inconsistency of shared data, the operation of shared data must be locked. In java, synchronized keyword can be used to achieve exclusive lock, but there are two major drawbacks in using this keyword: 1. The blocking time of threads cannot b ...

Added by zizzy80 on Sat, 05 Oct 2019 10:01:37 +0300

Several methods of removing superfluous characters at the end of a string

title: Several methods of removing superfluous characters at the end of a string date: 2018-08-17 22:12:58 tags: [Java, method] --- When splicing strings, we often find many unwanted characters, which are very annoying. Here are three ways to get rid of annoyance. //Cyclic generation of json format data public static String CreateJson() { ...

Added by JsF on Sat, 05 Oct 2019 08:44:35 +0300

0 OTA user version upgrade failed, debug upgrade succeeded

The company's own ota upgrade apk, download upgrade package upgrade, prompt package compatibility verification failed; The errors reported by different OTA apks may be different, and the log s should be the same; 9.0 has strict authority management. avc: denied { read } for name="config.gz" dev="proc" i ...

Added by miramichiphoto on Sat, 05 Oct 2019 04:27:35 +0300

Introduction of SPI implementation principle

Introduction of SPI implementation principle SericeLoader Load method Finding Implementation Classes Create examples SericeLoader from SPI Practical Learning in JAVA One of the most important ways to implement lookup is to: ServiceLoader shouts = ServiceLoader.load(Handler.class); Its class stru ...

Added by non_zero on Fri, 04 Oct 2019 22:51:25 +0300

JFinal automatic routing registration saves development time

1. Implementation of Route Registration Route auto-registration is easy to implement, just get all the Controller configuration to route, the code is as follows package com.nmtx.route; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jfinal.config.Routes; import com.jfinal ...

Added by Boo-urns on Fri, 04 Oct 2019 20:08:31 +0300

Java Double Loop Printing Patterns

Links to the original text: https://blog.csdn.net/yajing8/article/details/73548896 Using Java double loop to print various pattern summaries: the outer loop controls the number of rows, which is fixed, and the inner loop controls the output ...

Added by doofystyle on Fri, 04 Oct 2019 18:37:15 +0300

SpringBook integrates Jwt to generate token tokens (session can be replaced when front and back ends are separated)

Overview of token tokens generated by Jwt 1. Stateful landing and stateless landing Stateful service, that is, the server needs to record the client information of each session to identify the identity of the client and process requests according to the identity of the user, such as session in tomcat ...

Added by mrodrigues on Fri, 04 Oct 2019 17:04:39 +0300

Use of Collections Tool Classes

/* reverse(List): Reverse the order of elements in a List * shuffle(List): Random sorting of List set elements * sort(List): Sort the elements of a specified List collection in ascending order according to the natural order of the elements * sort(List,Comparator): List collection elements are generated ...

Added by wilhud on Fri, 04 Oct 2019 16:13:20 +0300

Leetcode brush Title java 349. intersection of two arrays

Implementation results: adopt Display details Execution time: 8 ms, beating 66.35% of all Java submissions Memory consumption: 37.6 MB, beating 29.53% of all Java submissions Title: Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = ...

Added by Rhysyngsun on Fri, 04 Oct 2019 11:52:13 +0300