Looking at JDK dynamic agent from mybatis source code

Many articles about dynamic agent on the Internet are like this: A Real class for practical work; a Proxy class created. Proxy calls the proxy method in Real, and prints some strings before and after the proxy method. For example: 1 public class JdkProxy { 2 static interface IProxy{ 3 String say(String s); 4 } 5 static ...

Posted on Mon, 06 Apr 2020 03:32:00 -0400 by nikifi

Comments and Reflections - Review

Catalog annotation Built in annotations Meta annotation Custom annotation Reflection mechanism brief introduction Class Class Java memory Class loading process ClassLoader Reflection gets the structure information of the runtime class Creating objects dynamically Create objects by reflection (general) Create an object with constructor ob ...

Posted on Mon, 06 Apr 2020 01:09:04 -0400 by gumby51

Detailed interpretation of AQS source code

[TOC] Basics Before explaining AQS, there are a few additional knowledge to understand.Knowing this will help you understand the rationale of many of the code in the AQS framework. CAS related knowledge Concurrent programming paradigm for thread suspension via identity bits Implementation Techniques for MPSC Queues Welcome to the technical ex ...

Posted on Sun, 05 Apr 2020 15:22:28 -0400 by tyweed

java Concurrent security

java Concurrent securityThe main thread safety and deadlock related knowledge points of this content.1. What is thread security1.1 thread safety definitionIn the previous eight paragraphs, I talked about Java Concurrent Programming. Have we ever thought about thread security? In the Java Concurrent Programming practice, it is defined as follows ...

Posted on Sun, 05 Apr 2020 12:42:05 -0400 by dooper3

Take a look at Java's lock - ReentrantLock

Preface AQS has spent 5 articles in total. I have annotated the core source code and described it in detail. I will talk about the actual use of AQS with you in the next few articles. I will mainly talk about several locks. In the first article, I will talk about ReentrantLock re-entry lock with you. Although I have also interleaved it in AQS, ...

Posted on Sun, 05 Apr 2020 08:44:45 -0400 by johnsonzhang

Slot, slot point for Java design

No water today, go straight to dry!Hope the following explanation will resonate with you.   1. Each length has its own merits   Have you ever been asked during an interview if there is a length() method for arrays?Does the string have a length() method?Does the collection have a length() method?   Faced with this problem, you have to spit out ...

Posted on Sun, 05 Apr 2020 01:43:36 -0400 by Jenk

Joda time in java date calculation

Joda time in java date calculation Joda time provides a set of Java class packages to handle date and time, including the ISO8601 standard. It can be used to completely replace JDK Date and Calendar classes, and still provide good integration.  http://joda-time.sourceforge.net/ Version: joda-time-2.1.jar1. Ti ...

Posted on Sun, 05 Apr 2020 01:05:29 -0400 by Amitk

zookeeper (single machine, pseudo cluster, cluster) deployment

ZooKeeper is a distributed, open-source, distributed application coordination service that enables application configuration management, unified naming service, and state synchronization service in a distributed environment.ZooKeeper is a highly available, high-performance open source coordination service designed for distributed applications, ...

Posted on Sat, 04 Apr 2020 19:03:04 -0400 by freelance84

Adapter mode of fabric mode

1 Overview Adapter pattern, as you can see from the name, works like an adapter: connecting two incompatible things to work together. 2 adapter mode Charger (power adapter) is a common example in daily life. The input voltage of most mobile phones is 5V, while the voltage of household AC is 220V. As the adapter, the charger converts the voltage ...

Posted on Sat, 04 Apr 2020 16:54:53 -0400 by xjake88x

ZooKeeper --- installation configuration

Zookeeper: 1. It can be used as a cluster management tool. 2. Profiles can be managed centrally. 1.1.1. Installation of Zookeeper Installation environment: Linux: centos6.4 JDK: above 1.7 Zookeeper is developed by java and can run in windows and linux environment. The jdk needs to be installed first. Installation steps: Step 1: insta ...

Posted on Sat, 04 Apr 2020 02:13:10 -0400 by pheagey