Several special ways of Spring Bean instantiation

ServiceLoader uses the reverse control in JDK ServiceLoaderFactoryBean AutowireCapableBeanFactory#createBean BeanDefinitionRegistry#registerBeanDefinition RumenzFactory interface and default implementation class DefaultRumenzFactory RumenzFactory.java package com.rumenz; public interface RumenzFactory { //jdk1.8 default implementation ...

Posted on Tue, 30 Jun 2020 02:10:36 -0400 by HektoR

Simple use of Spring Cloud Config

This article is the summary of the book "Spring Cloud micro service practical war" quick get start Build configuration center Create a basic Spring Boot project and add dependency: <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>sprin ...

Posted on Sat, 27 Jun 2020 23:59:04 -0400 by loveitandhateit

The solution of lock in Java

1. Optimistic lock and pessimistic lock Optimistic locks and pessimistic locks should be the first two types of locks that every developer contacts. Application scenarios are mainly used to update data, which is also one of the most important scenarios for using locks. The main process of updating d ...

Posted on Sat, 27 Jun 2020 04:21:02 -0400 by phpbaby2009

Introduction and use of JDK dynamic agent

1, Introduction JDK dynamic proxy is a way to implement the proxy pattern. Because it is based on the interface to do the proxy, so it is often called interface proxy. There are two important roles in the JDK dynamic agent: InvocationHandler(Interface) The user implements this interface to write the ...

Posted on Fri, 26 Jun 2020 01:15:15 -0400 by plisken

How does Java implement the Future pattern? Detailed explanation of ten thousand words!

JDK1.8 source code analysis project (Chinese note) Github address: https://github.com/yuanmabiji/jdk1.8-sourcecode-blogs 1 what is future? For example, when we buy things online, an order number will be generated after placing an order, and then the merchant will deliver goods according to the order number, and then there will be a delivery ord ...

Posted on Fri, 26 Jun 2020 00:53:48 -0400 by virtual_odin

Notes on Java learning

Notes on Java introduction 2 - Hao bin abstract class Abstract method abstract class Final keyword Final decorates the entire class Some properties in the Final modifier class interface (interface) Definition of interface Format of interface Syntax knowledge of interface Function of interface Th ...

Posted on Thu, 25 Jun 2020 22:40:21 -0400 by justdiy

Common knowledge accumulation of spring boot development

Article catalog SpringBoot get Request and Response Transaction uses @ Transactional AOP development process SpringBoot get Request and Response Through static method acquisition, you can also encapsulate a static method public String test() { ServletRequestAttributes attributes = (ServletReque ...

Posted on Thu, 25 Jun 2020 06:50:11 -0400 by expert_21

Introduction and use of [Java] LocalDate/LocalTime/LocalDateTime class

background Briefly describe the background of these new date API s in JDK 1.8. As early as in the era of JDK 1.0, JDK includes a time-dependent java.util.Date Class, and because of its own shortcomings, most of its methods were introduced in the era of JDK 1.1 Calendar Class. The Calendar class is not ...

Posted on Thu, 25 Jun 2020 00:06:45 -0400 by twistisking

Deep analysis of Map source code

preface map set is the set of key value The difference between HashMap and HashTable HashMap is thread unsafe. HashTable is read and write with synchronized lock. It is thread safe and inefficient. Hashtab cannot store null key and value. HashMap can store null key and value in the first position of ...

Posted on Wed, 24 Jun 2020 22:22:38 -0400 by thomasadam83

Full parsing of regular expressions

Regular expressions define patterns for strings that can be used to search, edit, or process text. 1, Regular basic knowledge points 1.1 metacharacter Metacharacters are one of the basic elements in constructing regular expressions. Several commonly used metacharacters: Metacharacter explain ...

Posted on Tue, 23 Jun 2020 04:02:40 -0400 by jeanne