Calculate the greatest common divisor tasks

Assignment Help Computer Engineering
Reference no: EM131491896

Assignment

Java RMI (Remote Method Invocation, reference Chapter 5 of the textbook and Week-3 lecture) enables the local invocation and remote invocation use the same syntax to implement generic remote servers like the Compute Engine example in Week-3 lecture slides. However, Java RMI needs 2 HTTP servers to transfer Java classes between a RMI client and a RMI server at runtime. In addition, Java RMI applications need a RMI Registry for registering or looking up the remote objects.

In this assignment (assignment-2), you are to implement a remote invocation framework that is similar to Java RMI but lightweight (note: for this assignment, you don't use any Java RMI APIs). To implement the framework, you will need to use Java Interface, Java Objection Serialization, Java Thread and client/server model. Recall you have created some Java examples about these Java components and models for assignment-1; now you will need to use these Java components as a reference to build this framework. Thus if necessary, you may need to review your assignment-1.\

This assignment specification is as follows.

Part 1: Java TCP Networking, Multi-threading and Object Serialization Programming

The framework consists of a compute-server, a compute-client and a codebase repository, which are depicted in the following diagram. The framework is a generic computing architecture because the compute-client and compute-server just need to know the Task and CS Message components in advance before the framework can start to run. The specification of the components is as follows.

670_Figure.png

1. The interaction contract

The interaction contract between the client and server is defined by the Task interface:

//The Task interface (interaction contract) between clients and the server

public interface Task {

 public void executeTask();

 public Object getResult();}

Every compute-task must implement the Task interface. Executing the executeTask() method will perform the task and set the result. Calling the getResult() method will return the result.

2. The compute-client and compute-server

The compute-server is used as a generic compute-engine. While running, the server is continuously waiting for the compute-tasks. A compute-task is created by a compute-client and sent as a serialized object to the compute-server. Once the compute-server receives a task, it will cast (deserialize) it into the Task interface type and call its executeTask() method. After executing the task, the compute-server will send the same object back to the computeclient.

The compute-client is continuously accepting a user's requests. Every request specifies a compute-problem and its corresponding parameters. For a request, the compute-client creates a compute-task and sends it as a serialized object to the compute-server. Once receiving the compute-task object back from the server, the compute-client will call the getResult() method of the object to display the result.

3. The codebase repository

Such a framework makes the compute-server generic. That is, the compute-server just needs to know the Task interface, then it can be compiled and run. If a compute-client implements a new compute-task after the server is run up, the compute-client just needs in some way (in real world application it could be a FTP server, but in this assignment, you just need to copy the files into a directory) to upload the Java class of the compute-task into a pre-determined network location (e.g. the codebase directory), which the compute-server can access from its Java classpath. Then the compute-server can perform such a new compute-task. Therefore, the server never needs to be shut down, recompiled, and restarted.

4. The error message

However, when there is an exception occurred (e.g. a compute-client wants the compute-server to perform a compute-task, but forgets uploading the Java class of the compute-task) onto the codebase of compute-server, the compute-server will create a CSMessage object and sends it back to the compute-client. Note: the CSMessage follows the interaction contract by implementing the Task interface. By calling the getResult() method, the compute-client will know the problem and fix it later on.

To implement the framework, you need to implement the following Java classes:

1. A Java application to implement the compute-client;

2. A Java application to implement the compute-server; and

3. A Java class to implement the request processing thread.

4. A number of Java classes to implement Calculate Pi, Calculate Primes and Calculate the Greatest Common Divisor tasks.

Part 2: Program use and test instruction

After the implementation of the framework, prepare an end user instruction about how to use your software.

Attachment:- Assignment Files.rar

Reference no: EM131491896

Questions Cloud

Difference between system and application software : What is the difference between system and application software? How do these affect you as a business end user? please provide references.
What is the goal of a vpn tunnel : Draw a sketch of the encapsulation of a VPN data packet. Show the IP source and destination address and the VPN tunnel source and destination address.
Total number of binary number combination : What is the formula that will define the total number of binary number combination that can be made when given the number of binary bits available?
How much will you pay for the company stock today : Can Corporation will pay a $3.02 per share dividend next year. how much will you pay for the company's stock today?
Calculate the greatest common divisor tasks : A number of Java classes to implement Calculate Pi, Calculate Primes and Calculate the Greatest Common Divisor tasks
Research the four access control models : Research the four access control models and identify use cases for each within a typical organization, such as your work or school.
What is annual carrying costs of post card inventory : Post Card Depot, large retailer of post cards, orders 9,851,860 post cards per year from its manufacturer. What is annual carrying costs of post card inventory
List the two router commands : List the two router commands for specifying the tunnel destination and source IP address. Include the router prompt.
Content very engaging and interesting : She is short on time and asks you to make the content very engaging and interesting for her audience.

Reviews

len1491896

5/11/2017 4:31:49 AM

Australian student, need it as per the guidelines. Need both the parts alongwith the screenshots of execution. You need to provide the following files in your submission. Files of Java source code of the compute-client, the compute-server and the processing thread and the compute-tasks. The in-line comments on the data structure and program structure in the programs are required. These source code files must be able to be compiled by the standard JDK (Java Development Kit) or NetBeans from Oracle. All the required files must be compressed into a zip file for submission. You must submit your assignment via the unit web site. Any hardcopy or email submission will not be accepted. After the marked assignments are returned, any late submissions will not be accepted.

Write a Review

Computer Engineering Questions & Answers

  Write a short memo explaining the concept to your boss

Using the Web, investigate the term, virtual desktop infrastructure (VDI). Write a short memo explaining the concept to your boss.

  Sequence of actual mips instructions

use a sequence of actual MIPS instructions to implement the similar behavior.

  Show how to connect given ttl to right circulate the input

TTL 74194 is a 4-bit universal shift register. Show how to connect TTL 74194 to left shift the input discarding the leftmost bit and setting the rightmost bit.

  What is the importance of an e r diagram

What is the importance of an E-R diagram in facilitating event-driven systems and the integration of data between business processes?

  Write down a method definition to count

Write down a class declaration for a student that has String first, last, and middle names as data fields. Declare only the data members and a no-arg constructor.

  Printing of fibonacci series

Write down a program which utilized a loop to determine the first seven values of Fibonacci number sequence explained by the following formula.

  Write a c program that inputs several lines of multiple word

Write a c program that inputs several lines of multiple words, then a search character, and uses the function strchr to determine the total occurrences of the character in the lines of text.

  Identify the addressing modes for the given instructions

Identify the addressing modes for the following instructions: NOP.

  The indicators management of the practice monitor

The Metropolitan Medical group (MMG) merged with Oak Grove Medical Group (OGMG) . The Oak Grove Medical Group has 4 offices and owns medical office building where their imaging and radiology lab and physical therapy and diagnostic laboratory center..

  C program to implement sieve of erastosthenes

Prepare a C program which implements the Sieve of Erastosthenes and determines the primes among the first N integers that you enter through a prompt or the command line.

  Compare and contrast monitoring of patient vital signs by

mobile computing has dramatically changed how information is accessed and shared. wireless networking has been an

  Create a storyboard diagram depicting the layout of website

Create a narrative that describes the site to your prospective client. Imagine that your narrative has been approved. Use Word, Visio, or Dia to: Create a storyboard diagram depicting the layout of your Website.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd