Centos 7.X standalone deployment DB2 10.5

Preparation of system bottom layer Install jdk tar xvf jdk-7u79-linux-x64.tar.gz vi /etc/profile #Set JDK environment variable: add JDK environment variable setting at the end of vi /etc/profile: JAVA_HOME=/usr/local/java JRE_HOME=/usr/local/java/jre CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME ...

Posted by consultant1027 on Wed, 04 Dec 2019 04:00:02 +0100

Singleton best practices - enumeration types for single elements

Next, we will introduce several ways to implement Singleton: First: double check lock [not recommended] public class Singleton { private volatile static Singleton instance; private Singleton(){}; public static Singleton getInstance() { if (instance == null) { synchronized (Singleto ...

Posted by senthilnayagam on Wed, 27 Nov 2019 18:11:10 +0100

Take a look at the new features of Java -- other new features

A summary of the remaining Java 8 new feature knowledge points, including: default method, Optional, completable future, time related. Default method The default methods are all to help new Java functions to be compatible with the programs developed in the lower version of JDK For example, to add new methods to an existing interface of a lower ...

Posted by blackhorse on Sun, 24 Nov 2019 13:14:40 +0100

[concurrent programming] atomic operations in Java

What is atomic operation Atomic operation refers to one or more indivisible operations. The execution order of these operations can not be disrupted, and these steps can not be cut and only part of them can be executed (non interruptibility). For example: //It's an atomic operation int i = 1; //Non atomic operation, i + + is a multi-step opera ...

Posted by five on Fri, 22 Nov 2019 11:48:39 +0100

001. Analysis of operation principle of JAVA program

1. First look at the structure of the JVM runtime data area Thread exclusive: Each thread has its own space that is created and destroyed with the thread lifecycle. Thread sharing: All threads have access to this memory data, which is created and destroyed with the virtual machine GC. JVM stores loaded class information, constants, static var ...

Posted by shawngoldw on Thu, 21 Nov 2019 19:38:35 +0100

MQTT protocol performance test: use jmeter+ant+emqx to test and generate test report

preparation: 1) install jdk and configure environment variables. Please search for specific steps by yourself 2) install jmeter3.1 and above 3) jmeter installs the mqtt plug-in: Mqtt xmeter - [required version] - jar-with-dependencies.jar , put it in the EXT folder of JMeter installation directory (for example, F:\testPro\ap ...

Posted by jimmyt1988 on Tue, 19 Nov 2019 20:55:58 +0100

Getting started with java distributed calling and customizing RPC framework based on reflection socket JKD dynamic proxy

Using IDEA, Myeclipse Write service interface HelloService Server implementation class Write the calling class of the server package whu; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.lang.reflect.Method; import java.net.ServerSocket; import java.net.Socket; public class RpcFramework { //Regi ...

Posted by figo2476 on Wed, 13 Nov 2019 20:06:05 +0100

Shock!I unexpectedly found a problem with the JDK source

Thoughts on Source Reading Recently looking at the source of the thread pool under the concurrent package, I found a problem with the JDK source when I saw the ThreadPoolExecutor class.The following is the code snippet for the addWorker method of the ThreadPoolExecutor class: boolean workerStarted = false; boolean workerAdded = false; Worker w ...

Posted by cbrian on Wed, 13 Nov 2019 02:40:36 +0100

Pipeline flow and wait / notify cross backup

I. inter thread communication through pipeline 1.1 pipeStream A special stream used to transfer data directly between threads. One thread sends data to the output pipeline, and the other takes data from the input pipeline. By using pipes, communication between different threads can be realized without the aid of something li ...

Posted by dragin33 on Tue, 12 Nov 2019 00:14:37 +0100

[code reconstruction and optimization] 1. Use Lambda to optimize the code and the beauty of Lambda expression

I. optimize threads //JDK 1.7 and earlier Thread thread = new Thread( new Runnable() { @Override public void run() { System.out.println("Raw thread"); } } ); //Lambda created after JDK 1.8 Thread thread2 = new Thread(() -> { System.out.println("Lambda Create thread"); }); 2. Opti ...

Posted by nightkarnation on Sat, 09 Nov 2019 17:52:14 +0100