Book Image

Distributed Computing in Java 9

Book Image

Distributed Computing in Java 9

Overview of this book

Distributed computing is the concept with which a bigger computation process is accomplished by splitting it into multiple smaller logical activities and performed by diverse systems, resulting in maximized performance in lower infrastructure investment. This book will teach you how to improve the performance of traditional applications through the usage of parallelism and optimized resource utilization in Java 9. After a brief introduction to the fundamentals of distributed and parallel computing, the book moves on to explain different ways of communicating with remote systems/objects in a distributed architecture. You will learn about asynchronous messaging with enterprise integration and related patterns, and how to handle large amount of data using HPC and implement distributed computing for databases. Moving on, it explains how to deploy distributed applications on different cloud platforms and self-contained application development. You will also learn about big data technologies and understand how they contribute to distributed computing. The book concludes with the detailed coverage of testing, debugging, troubleshooting, and security aspects of distributed applications so the programs you build are robust, efficient, and secure.
Table of Contents (17 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Customer Feedback
2
Communication between Distributed Applications
3
RMI, CORBA, and JavaSpaces

Java 9 updates for processing an API


Java 9 provides a refined Process API to control and manage the process with better performance in your operating system.

Process control could be made easier by accessing the process ID (PID), username, and resource utilization with the processing path information from the operating system. The multithreaded approach from previous versions is refined to easily deal with process trees and destruct or manage processes that have multiple subprocesses.

The following is an example of retrieving the PID of the current process with this API:

private static int getOwnProcessID(){
  return ProcessHandle.current().getPid();
}

The following is a code snippet for getting a list of all the processes running on the operating system:

private static void listProcesses(){
  ProcessHandle.allProcesses().forEach((h) -> printHandle(h));
}     

private static void printHandle(ProcessHandle procHandle) {
  // get info from handle
  ProcessHandle.Info procInfo = procHandle...