Dubbo Service Reference Principle

Dubbo Service Reference Principle   Service reference principle, first look at the code call logic, and then step-by-step debug. Consumer References: ReferenceBean.getObject() -->ReferenceConfig.get() -->init() -->createProxy(map) -->refprotocol.refer(interfaceClass, urls.get(0)) ...

Posted by inosent1 on Thu, 31 Oct 2019 04:11:05 -0700

Java description design pattern (16): agent pattern

Source code: GitHub point here || GitEE point here I. life scene 1. Scene description Today, with the rapid development of e-commerce, the number of express delivery is very large, and even there is the express agent industry. Simply speaking, the owner of express delivery does not have time to receive express delivery, and will designate a co ...

Posted by DarkShadowWing on Tue, 29 Oct 2019 09:35:43 -0700

Modification of SnowFlake algorithm in Twitter: a 53bit distributed ID generator compatible with JS truncation

Preface    as we all know, in the distributed global unique ID generator scheme, SnowFlake algorithm, which is open-source by Twitter, is compared with the transponder algorithm that needs to be deployed represented by meituan Leaf. Because of its advantages such as high performance, simple code, no dependence on third-party services ...

Posted by blacksnday on Mon, 28 Oct 2019 00:09:21 -0700

Source code analysis of Spring Aop

1. Dynamic agents: Jdk and Cglib I. principle difference: java dynamic proxy uses reflection mechanism to generate an anonymous class that implements the proxy interface. It calls InvokeHandler before calling the specific method. cglib dynamic proxy uses asm open source package to load the class file ...

Posted by Grande on Sat, 26 Oct 2019 07:14:54 -0700

Java Concurrent Programming practice reading notes -- Chapter 2 thread safety

Prompt (click jump) 2.1 what is thread safety? 2.2 atomicity 2.2.1 race conditions 2.2.2 race condition in delay initialization 2.2.3 composite operation 2.3 locking mechanism 2.3.1 built in lock 2.3.2 reentrant 2.4 use lock to protect state 2.5 activity and performance The ...

Posted by ngu_tri on Fri, 25 Oct 2019 22:47:12 -0700

A detailed explanation of synchronized in Java

I. concept synchronized is a key word in Java. It uses the lock mechanism to achieve synchronization. The locking mechanism has the following two characteristics: Mutex: that is, only one thread is allowed to hold a certain object lock at the same time. Through this feature, the coordination mechanism in multithreading is realized, so that ...

Posted by fil on Fri, 25 Oct 2019 02:07:21 -0700

Why is + not recommended in Alibaba Java development manual for string splicing in cyclic body?

When reading the Alibaba Java development manual, I found that there is a suggestion about string splicing in the loop body. The specific content is as follows: Let's first take an example to see the efficiency of string splicing with + or StringBuilder in the loop body (JDK version is jdk1.8.0_). package com.wupx.demo; /** * @author wupx * ...

Posted by stueee on Wed, 23 Oct 2019 10:12:04 -0700

Netty high performance component -- FastThreadLocal source code analysis (see the real chapter for details)

1. Preface netty encapsulates FastThreadLocal to replace the ThreadLocal provided by jdk. Combined with the encapsulated FastThreadLocalThread, variables in multithreaded environment improve the query and update efficiency of ThreadLocal objects. In the following, by comparing ThreadLocal with FastThreadLocal, and by analyzing the source code, ...

Posted by guoxin on Sun, 20 Oct 2019 01:48:00 -0700

Vi. explicit lock and AQS

Explicit locks and AQS I. explicit lock The Synchronized keyword combines with the monitor of the object. The JVM provides us with a kind of semantics of "built-in lock". This kind of lock is very simple. We don't need to care about the process of locking and releasing the lock. We just need to tell the virtual machine which code bloc ...

Posted by duhhh33 on Thu, 17 Oct 2019 15:28:40 -0700

java calling C + + code in windows and linux environment JNI Technology

Recently, the department needs to call C + + code for Android mobile development, which is very difficult. The final task is given to me to find relevant information. No one tutorial can explain how to call in different environments (windows,linux). I stepped on several holes in the implementation process. In this summary, I hope to see less de ...

Posted by Revlet on Thu, 17 Oct 2019 02:43:21 -0700