Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Write JAVA Program: Amazon Order Processing (Multi-Threading)

Write JAVA Program: Amazon Order Processing (Multi-Threading)

Write JAVA Program: Amazon Order Processing (Multi-Threading)

Description

JAVA OBJECT-ORIENTED PROGRAM:

CONCEPT: MULTI-THREADING

AMAZON ORDER PROCESSING

TO DO (1):

Problem Description:

Using ArrayBlockingQueue as a buffer, you will construct a program that will emulate the processing of an order from Amazon.com (or any online order) from when you place the order to when it gets put on the truck for delivery to your home.

Your program will be structured as shown in the tree (attached in zip below)

Each node must:

  • Run in its own thread
  • Contain one input buffer and 1-2 output buffers.  Two exceptions:
    • The Web Server node reads from a file and does not have an input buffer
    • The Delivery Truck Nodes print to the screen using a creative graphic display and do not have output buffers.

Additional Specifications:

  • The buffer between two nodes must be shared.
  • The only means of communication between nodes is the buffer between them.

Functionality of Each Node

Amazon Web Server Node

Receives orders containing the following information:

  • Delivery address
  • Name on order
  • Item ordered
  • Item category

This node must read these orders from the S24_AmazonOrderProcessing_OrdersFile.csv file (attached) which resembles the following table (attached in zip)

For each order received, it decides which Shipping Center to send it to based on the following logic:

  • Orders to the following cities got to Shipping Center 1:
    • Los Angeles
    • San Francisco
    • Seattle
    • Denver
  • Orders to the following cities go to Shipping Center 2
    • Des Moines
    • Chicago
    • St. Louis
    • Any other city not already mentioned

Also, when this node reaches the end of orders in the .csv file, it must send some sort of indication to all the Shipping Center nodes through the shared buffer that the end has been reached and then terminate.

Shipping Center

The Shipping Center must decide which part of the warehouse the item is in and send a command to the appropriate forklift to go get it and deliver it to the shipping dock.

The Shipping Center organizes items based on the first letter of their category.  It will also append the Shipping Center number to the order for tracking purposes.

The processing is as follows:

  • Orders with categories beginning with A-P go to Section 1
  • Orders with categories beginning with Q-Z go to Section 2

Shipping Center Sections:

The Shipping Center Sections will do the following:

  1. Receive order
  2. Append the Shipping Center Section number to the order for tracking purposes
  3. Pause for 0-5 seconds.  This period must be decided randomly
  4. Put order on the Shipping Dock’s buffer

Shipping Dock

The Shipping Dock nodes will fill up the buffers to the trucks as there is room available. They will start with truck 1.  If the buffer for Truck 1 is full, then try truck 2.  If they are all full, then wait until one buffer becomes available.

Trucks

The trucks perform the following sequence:

  1. Read from their input buffer until they have received 4 deliveries or receive notification that there are no more deliveries.  On each delivery, they must append the truck number for tracking purposes.
  2. For each of the four deliveries (or less if the “no more deliveries” notification was received), do the following:
    1. Sleep for 0-10 seconds.  This period must be decided randomly.
    2. Print out the information on the shipping order to the screen

The truck also must also print out a message to the screen after it has received the ¯ more deliveries.otification and delivered its last order indicating that it is done delivering.  This message should specify the truckànumber and the number of its associated shipping center.

The Shipping order information printed to the screen must include the following information:

  • Delivery address
  • Name on order
  • Item ordered
  • Item category
  • Shipping Center the order went through
  • Shipping Center Section the order went through
  • Delivery Truck the order was delivered on

Important Requirements

  • The program MUST be multi-threaded or it will not meet the homework requirements for the Oral Exam.
  • The program must not continue on indefinitely.  All threads must stop on their own once all orders have been processed.  All orders received must be delivered.
  • **Only the Delivery Truck nodes should print to the screen and they should print ONLY what is specified in their specifications. This requirement is to allow us to grade this problem easily.

————————————————————————————————————————————————————-

TO DO (2):

1) Please write descriptions for (example attached in zip): problem statement, user documentation, and developer documentation

2) *important* Add LOTS OF COMMENTS (example attached in zip) and mostly EXPLAIN how this particular code structure is processed <– overall, I want to better understand how this code works in java language and get a better understanding of how multi-threading works in this code! (will add a tip if satisfied with the explanation and comments)

3) Please add JavaDoc comments if necessary

4) Make sure the program is running without any errors and is OBJECT-ORIENTED and MULTI-THREADED!

5) If you can, add additional notes if there were parts of the code that you could have done differently 

Explanation & Answer:

Worksheet
User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Essay Noon only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Essay Noon are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Essay Noon are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Essay Noon, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20