Thread state transition and code proof (just look at this article, with diagram and code verification)

background Take you to understand the thread state in Java, with pictures and code display, all dry goods. summary Look at the State enumeration in the Thread class, which is the State of the Java Thread. There are many states on the Internet. You can see that this enumeration is more authoritative. All kinds of nouns, what can be run, ready ...

Added by dixondwayne on Tue, 01 Mar 2022 06:37:44 +0200

[Yugong series] March 2022 ASP Net core Middleware - current limiting

1, Current limiting algorithm In high concurrency systems, there are three sharp tools to protect the system: caching, degradation and current limiting. This paper mainly introduces current limiting. There are three current limiting algorithms: 1. Counter algorithm Fixed windowsliding window 2. Token bucket algorithm3. Leaky bucket ...

Added by ranjuvs on Tue, 01 Mar 2022 03:50:04 +0200

Kill Session? This cross domain authentication solution is really elegant

User login authentication is a very common business in Web applications. The general process is as follows: The client sends the user name and password to the serverAfter the server-side verification is passed, save relevant data in the current session, such as login time, login IP, etc.The server returns a session to the client_ ID, which the ...

Added by soulzllc on Tue, 01 Mar 2022 03:29:06 +0200

Interview assault 26: how to stop threads correctly?

There are three ways to stop threads in Java:Customize the interrupt identifier to stop the thread.Use the thread interrupt method interrupt to stop the thread.Use stop to stop the thread.The stop method is an expiration method modified by @ Deprecated, that is, it is not recommended to use. Because the stop method will directly stop the thread ...

Added by Rob the R on Tue, 01 Mar 2022 02:49:51 +0200

Source code analysis of Spring Cloud Nacos for dynamic configuration loading

After understanding the basic principle of the above Environment, how to load the configuration from the remote server into the Spring Environment.NacosPropertySourceLocatorFollowing the above analysis ideas, we naturally went to find the implementation class of PropertySourceLocator and found that in addition to our customized GpJsonPropertySo ...

Added by inspire on Tue, 01 Mar 2022 02:24:53 +0200

First knowledge of Java -- use of methods

catalogue 1, Basic usage of method ๐Ÿš† What is the method โญ Significance of the method ๐Ÿ‰ Definition method ๐Ÿ‰ Execution procedure of method call ๐Ÿ‰ Relationship between argument and formal parameter ๐Ÿ‰ Method with no return value 2, Overloading of methods ๐Ÿ‰ Overload problems to be solved ๐Ÿ‰ Use method overload ๐Ÿ‰ Overloaded ru ...

Added by suprsnipes on Tue, 01 Mar 2022 01:14:55 +0200

Gets the property structure and its internal structure of the runtime class [Java]

Gets the attribute structure and its internal structure of the runtime class The internal structure of the attribute structure we are talking about here is the permission modifier of the attribute, the data type of the attribute, the name of the variable, and so on. There are two ways to get the attribute structure of a runtime class: getFi ...

Added by aayatoos on Mon, 28 Feb 2022 19:44:51 +0200

Object Oriented Feature -- inheritance [java]

Basic concept: when multiple classes have the same characteristic behavior, we can extract the same content from these classes to form a public class, and then derive a new class from the public class. The new class can inherit the data properties and behavior of the existing class and expand new capabilities. java uses the extends keyword to ...

Added by Indersingh on Mon, 28 Feb 2022 18:54:14 +0200

JDBC and Mybatis common bugs

Problem description Because spring boot usually simplifies the configuration and feels a little handmade, I handwritten JDBC and Mybatis in Mybatis class today. At the same time, there were several problems, which are recorded here. 0x01 JDBC insert Chinese garbled code The code is as follows The characters are still normal when the con ...

Added by devstudio on Mon, 28 Feb 2022 17:40:00 +0200

java learning notes

java learning notes (7) Start learning java and form the habit of blogging. I hope I can stick to it. Small partners with similar interests can learn together java Foundation 22, Array Definition of array An array is an ordered collection of data of the same typeArray describes several data of the same type, which are arranged and combined ...

Added by dimxasnewfrozen on Mon, 28 Feb 2022 16:26:51 +0200