Brief summary- I want a java program that simulates a gas refilling system. There would be a server and some components (JAVA RMI)
1. The server would be a gas station that has an amount of gas (500 liters)
2. The first client would be 2 gas trucks (t1 and t2) they will supply the gas station with gas anytime it is below a certain amount.
3. The third client would be 2 cars (c1 and c2) they will come to the gas station to collect gas
So the program doesn't need any UI, it should be able to run when run is clicked, It should run automatically without any human input.
Basically, it should print out every 1 second that car 1 or car 2 has taken a random amount of gas from the station, then when the amount of gas is below a certain amount lets say 50 litres, either t1 or t2 will refill it to the max. and it should be printed out too.
There should be comments on all sections of the program, saying what it is doing (very important)
The structure and operational logic of the system must be in line with the criteria listed in the description of the first part of the task.
System component contracts must be described using software interfaces.
System component contracts and the software interfaces for those contracts must be rational and logical according to the purpose of those components.
The components interfaces and business logic must be maximally separated (as far as the chosen RPC mechanism allows it).
The descriptions and logic of components contracts must be independent of the specific features of the RPC mechanism.
For interactions with remote components, proxy classes that implement the contracts of those components must be used.
The system must not not have race conditions, deadlocks and livelocks.
System components must operate in continuous cycles.
Each system component must operate in a separate process.
System components must write a log of operations to standard output (stdout) or text files. The log must detailed enough to present a clear trace of the sequences of actions of each component, changes in component state, and causal relationships between actions and state changes.
There is an example i uploaded to show how it should look.
There would be other parts to be added later but I need this one first