Distributed Computing in Java 9
eBook - ePub

Distributed Computing in Java 9

Raja Malleswara Rao Pattamsetti

Share book
  1. 304 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Distributed Computing in Java 9

Raja Malleswara Rao Pattamsetti

Book details
Book preview
Table of contents
Citations

About This Book

Explore the power of distributed computing to write concurrent, scalable applications in JavaAbout This Book• Make the best of Java 9 features to write succinct code • Handle large amounts of data using HPC • Make use of AWS and Google App Engine along with Java to establish a powerful remote computation systemWho This Book Is ForThis book is for basic to intermediate level Java developers who is aware of object-oriented programming and Java basic concepts.What You Will Learn• Understand the basic concepts of parallel and distributed computing/programming• Achieve performance improvement using parallel processing, multithreading, concurrency, memory sharing, and hpc cluster computing • Get an in-depth understanding of Enterprise Messaging concepts with Java Messaging Service and Web Services in the context of Enterprise Integration Patterns• Work with Distributed Database technologies• Understand how to develop and deploy a distributed application on different cloud platforms including Amazon Web Service and Docker CaaS Concepts • Explore big data technologies• Effectively test and debug distributed systems• Gain thorough knowledge of security standards for distributed applications including two-way Secure Socket LayerIn DetailDistributed 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.Style and approachThis is a step-by-step practical guide with real-world examples.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Distributed Computing in Java 9 an online PDF/ePUB?
Yes, you can access Distributed Computing in Java 9 by Raja Malleswara Rao Pattamsetti in PDF and/or ePUB format, as well as other popular books in Informatik & Programmierung in Java. We have over one million books available in our catalogue for you to explore.

Information

Year
2017
ISBN
9781787122734

RMI, CORBA, and JavaSpaces

Distributed computing has gotten stronger than before as it now provides the ability to handle communication over a network with distributed objects. Though there are a number of different ways to create distributed objects across a distributed network, distributed computing is preferred as it provides you the ability to access any component in a distributed system. In this system, the number of resources and the way to access them has enriched with the use of technologies that let you handle distributed objects effectively. The protocol through which these objects can be communicated is an essential concept to understand.
In this chapter, we will cover the following topics:
  • Remote Method Invocation (RMI)
  • What is RMI?
  • Key terminologies of RMI
  • RMI for distributed computing
  • RMI programming
  • Common Object Request Broker Architecture (CORBA)
  • CORBA standards
  • Inter-ORB communication
  • OMG IDL samples
  • CORBA services
  • CORBA programming
  • JavaSpaces
  • How Java 9 adds value
Let's start our discussion with RMI. This is where we will establish interaction between applications as per the concept of remotely deployed Java applications.

RMI

When it comes to meeting high-performance system expectations, message-driven systems provide quite a few features; however, they have certain limitations. Remote-object-based systems have been considered an alternative for message-based systems for a while; however, the latest message-based-system implementation has improved in this regard.

What is RMI?

RMI is a Java-specific object-oriented extension of the Remote Procedure Call (RPC). It provides a mechanism to create Java-based distributed applications. It allows an object in one Java Virtual Machine (JVM) to interact with the object in another JVM by invoking the methods in that object. This is why an application built with an RMI is considered an application that could run across multiple JVMs.
RMI provides communication between applications that are deployed on different servers and connected remotely using objects called stub and skeleton. This communication architecture makes a distributed application seem like a group of objects communicating across a remote connection. These objects are encapsulated by exposing an interface, which helps access the private state and behavior of an object through its methods.
The following diagram shows how RMI happens between the RMI client and RMI server with the help of the RMI registry:
RMI REGISTRY is a remote object registry, a Bootstrap naming service, that is used by RMI SERVER on the same host to bind remote objects to names. Clients on local and remote hosts then look up the remote objects and make remote method invocations.
The following are some of the design considerations of applications built with an RMI:
  • Seamless method invocation on objects created across multiple JVMs
  • Ensuring the remote method invocation integrates easily with general programming logic with no external IDL while retaining most of Java's object semantics
  • Setting up the ability to distinguish between a distributed and local object model
  • Assisting in building reliable applications while maintaining Java's safety and security
  • Extending support to multiple transport protocols, various reference semantics, such as persistence and lazy activation, and various invocation mechanisms
  • Handling issues such as running in different memory spaces, parameter passing, data binding, and other failures of RPC
  • Handling any additional problems, such as distributed garbage collection and distributed class loading

Key terminologies of RMI

The following are some of the important terminologies used in a Remote Method Invocation.
Remote object: This is an object in a specific JVM whose methods are exposed so they could be invoked by another program deployed on a different JVM.
Remote interface: This is a Java interface that defines the methods that exist in a remote object. A remote object can implement more than one remote interface to adopt multiple remote interface behaviors.
RMI: This is a way of invoking a remote object's methods with the help of a remote interface. It can be carried with a syntax that is similar to the local method invocation.
Stub: This is a Java object that acts as an entry point for the client object to route any outgoing requests. It exists on the client JVM and represents the handle to the remote object. If any object invokes a method on the stub object, the stub establishes RMI by following these steps:
  1. It initiates a connection to the remote machine JVM.
  2. It marshals (write and transmit) the parameters passed to it via the remote JVM.
  3. It waits for a response from the remote object and unmarshals (read) the returned value or exception, then it responds to the caller with that value or exception.
Skeleton: This is an object that behaves like a gateway on the server side. It acts as a remote object with which the client objects interact through the stub. This means that any requests coming from the remote client are routed through it. If the skeleton receives a request, it establishes RMI through these steps:
  1. It reads the parameter sent to the remote method.
  2. It invokes the actual remote object method.
  3. It marshals (writes and transmits) the result back to the caller (stub).
The following diagram demonstrates RMI communication with stub and skeleton involved:

RMI for distributed computing

Remote objects are similar to local objects when it comes to method invocation and returning results from methods. A remote object can be typecasted to any of the remote interfaces supported by its implementation, and the instanceof operator can be used to verify the type of remote or local object.
Although the aforementioned similarities exist between remote and local objects, they behave differently. While the clients of remote objects can only interact with remote interfaces, not with implementation classes, the clients of local objects can interact with both the interfaces and implementation classes. RMI is passed by a value, whereas a local method invocation can be passed by a reference. In this context, the mandatory remote exceptions must be defined in a local system.
The essential steps that need to be followed to develop a distributed application with RMI are as follows:
  1. Design and implement a component that ...

Table of contents