Interviewer: what is the execution order of Spring annotation @ After,@Around,@Before?

There are @ Before, @ After, @ Around, @ AfterRunning annotations in AOP.First up and down their own code, defined the definition of tangent point@Aspect @Component public class LogApsect { private static final Logger logger = LoggerFactory.getLogger(LogApsect.class); ThreadLocal<Long> startTime = new ThreadLocal<>(); ...

Posted by ricerocket on Thu, 11 Nov 2021 02:28:32 -0800

Take you in-depth understanding of merging and sorting

Merge sort 🎈🎆🎇 preface: 1, Priority queue heap PriorityQueue 2, Deep understanding of fast scheduling and optimization The number of times that merge sort is often tested in the eight sorts can be said to be among the best, and its status is also very high, which can not be ignored. In the sort of quick sort, merge sort and heap s ...

Posted by Froy on Thu, 11 Nov 2021 02:11:57 -0800

Java creates an SSH client, which has been open source ~

Source: https://blog.csdn.net/NoCortY...prefaceRecently, due to the project requirements, the project needs to implement the function of a webssh connection terminal. Because I did this type of function for the first time, I first went to GitHub to find out whether there are ready-made wheels that can be used directly. At that time, I saw many ...

Posted by danwguy on Thu, 11 Nov 2021 01:37:24 -0800

Solution of Dutch flag problem: additional space complexity O, time complexity O(N)

Dutch National Flag Problem         a. Given a sequence arr and a number num, put > num on the right of the array and < = num on the left of the array         b. Given a sequence arr and a number num, put > num on the right of the array, < num on the left of the array, and equal in the midd ...

Posted by Paddy on Thu, 11 Nov 2021 00:30:36 -0800

The configuration center writes the configuration to the spring environment

preface There are two configuration injections in the configuration center, one is before startup, and the other is dynamic configuration after configuration changes. This article mainly summarizes the pre startup configuration injection spring environment. Pre knowledge spring configuration will store the configuration in the PropertySo ...

Posted by pakenney38 on Thu, 11 Nov 2021 00:29:03 -0800

Comprehensive and thorough analysis of factory method mode

This article is excerpted from "design patterns should be learned this way" 1. Application scenario of factory method mode The factory method mode is mainly applicable to the following application scenarios. (1) Creating objects requires a lot of repetitive code. (2) The client (application layer) does not depend on the details of ho ...

Posted by oldtimer on Wed, 10 Nov 2021 21:15:18 -0800

Class loader subsystem

Parsing the. Class file javap -v xxxxx.class Or IDEA to install the jclasslib plug-in Class loader subsystem Class loader and loading process The class loader subsystem is responsible for loading class files from the file system or network. Class files have a specific file ID at the beginning of the fileClassLoader is only responsible for l ...

Posted by HK2ALL on Wed, 10 Nov 2021 21:10:04 -0800

Top ten sorting algorithms (fast sorting, merging, heap sorting and direct insertion) - Java implementation

Bubble sorting Start from the first element of the sequence to be sorted, constantly compare the values of adjacent elements, exchange if it is found that the reverse order, and gradually move the elements with larger values from front to back. Every time the maximum value of the sequence to be sorted is found, the maximum value is fi ...

Posted by almightyegg on Wed, 10 Nov 2021 20:12:43 -0800

maven java project configuration dual database (multi database configuration)

preface Why configure dual or multiple databases. When you need to obtain or insert data from two or more databases, the database driver, url path, username and password of each database are different. If you follow the configuration of a single database, you can only obtain the content of one database. explain According to my method, it is ...

Posted by Comtemplative on Wed, 10 Nov 2021 19:45:40 -0800

How to use virtual reference to manage out of heap memory in NIO

Virtual reference is the weakest reference. How weak is it? That is, you define a virtual reference, and you can't get the object through the virtual reference, let alone affect the life cycle of the object. The only function in a virtual reference is to queue to receive notification that the object is about to die. 1. Characteristics of virtu ...

Posted by xeno on Wed, 10 Nov 2021 19:34:26 -0800