Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Exam - Last Call

Rules:

Conduct

  • You are not allowed to use any sort of chatting tool and any other electronic device than the University computer, failing to follow this rule fails the student from the course and may be subject of sanctions in the form given by University rules.

    • Acts that put the student behavior under suspicious will cancel the exam and the student will be subject to a new exam under fully-controlled environment.
  • The only allowed websites are Google (for searching DOCUMENTATION), the official Oracle documentation and Github (including previous classes).

  • Equal or similar exams cancel both exams.

  • You are not allowed to leave the exam room without the examiner's authorization.

  • In case of misconduct, the examiner will not, at any time, take arguments in consideration during the exam. The student exam is cancelled, the student is notified and, in case the student does not agree, the decision must be appealed after the exam.

Exam Rules

  • You can use methods that you find convenient/better (e.g. different Serialization) as far as you fulfill the requirements (e.g. send a full object, create an RMI server etc)

  • In case of retake, the greatest grade is the valid one

  • The exam must be finished 10 minutes prior the lab reservation is over (i. e. 09:50)

  • With the exam grades there will be the time and place to re-check the exam with the examiner.

  • When finishing the exam, you must send this assignment to ferrari@caesar.elte.hu with copy to svu938@inf.elte.hu. for performing it, you shall call the examiner.

    • The usage of e-mail tools without the examiner supervision is forbidden.
  • The examiner will not give any support that is not regarding the exam flow (understanding of this description, computer setup etc). Students are expected to well know errors like Connection reset and Serialization error to pass this course.

Concurrent Noah

Noah got tech, your task is to develop the distribution of the Noah animals. The difference is that now you have two Noahs, and they need to take the animals concurrently. I.e. you will have two Client objects that will be listening to the same Server, this will read from an Array and give the names as requested by the clients.

What you need to know about Noah: It is a story of a man who put all the animals of the world in an ark (AKA big boat) and saved them from a flood (AKA big rain)

How it works step-by-step:

  • Server awaits for two connections
  • Two Clients connect to the Server
  • The Server starts two threads and send the Strings containing the name of the animals to the Clients.
  • Each Client send the received animals (one by one or on a batch) to a remote object Ark
  • Each Client calls the remote method listAnimals()

2 Points

  • Create a Server that waits for two connections;
  • Create a Client that connects to the Server;
  • Inside Server instantiate one instance of AnimalDeck;
  • Create a Thread with the created instance of AnimalDeck;
  • The Thread shall in a loop, send the animals to the Client using the already implemented function animals.takeTheFirst();
  • Print the information received in the Client;
  • Once you receive the two connections start two Threads, note that they will work concurrently, the animals cannot be duplicated, fix it using a lock; TIP: include try{sleep(1);}catch(Exception e){} after sending the String to the Client in the Thread so you can check if the lock is correctly implemented

3 Points

Justify the placement of the locks in the previous point.

4 Points

  • Implement Ark as a remote object and call it using RMI in the Client;
  • Use the AddAnimal function to add the animals one by one;
  • Print the return of listAnimals() in your Client.

5 Points

  • Make the RMI objects multithreaded so that they will not concur the Ark object, if you think this request does not make sense, write why in a comment in the RMI deployer.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages