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:
- Receive order
- Append the Shipping Center Section number to the order for tracking purposes
- Pause for 0-5 seconds. This period must be decided randomly
- 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:
- 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.
- For each of the four deliveries (or less if the “no more deliveries” notification was received), do the following:
- Sleep for 0-10 seconds. This period must be decided randomly.
- 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

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