Back
ExamFull examExam paper only

2015 09 09

Full exam for Middleware Technologies for Distributed Systems in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Politecnico)di)Milano))Middleware)T echnologies)for)Distributed)Systems))) 09th)of)September)2015)Rules: •)You are not allowed to use books, notes, or other material. •)You can answer in Italian or English. •)Total time for the test: 1.5 hours. •)Check the back of this page for

Middleware Technologies for Distributed SystemsFull exam

Document information

What's included in this study material

Full exam for Middleware Technologies for Distributed Systems in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Politecnico)di)Milano))Middleware)T echnologies)for)Distributed)Systems))) 09th)of)September)2015)Rules: •)You are not allowed to use books, notes, or other material. •)You can answer in Italian or English. •)Total time for the test: 1.5 hours. •)Check the back of this page for

Import quality: text was extracted directly from the original document.

Extracted content from the document

Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.

Page 1

Politecnico)di)Milano))Middleware)T echnologies)for)Distributed)Systems))) 09th)of)September)2015)Rules: •)You are not allowed to use books, notes, or other material. •)You can answer in Italian or English. •)Total time for the test: 1.5 hours. •)Check the back of this page for any additional exercises. 1.)Implement in Java a PhotoBook class that organizes a (finite) set of photos and uploads them to a remote host so that they can be shared with others. Suppose a Photo class exists, together with a class SharingSvc that provides the following method: void upload(String bookTitle, Photo[] photos, String[] captions). Class PhotoBook provides a constructor that specifies the maximum number of photos in the book and the book’s title. It also provides the following methods: int add(Photo p) : this method adds a new photo in the book’s first empty slot and returns the slot number. It suspends the caller if the book is full. void setCaption(int slot, String caption) : this method sets the caption for the photo in the given slot. void upload(SharingSvc svc): this method uploads the entire book to the given sharing service and clears the book, leaving it ready to be filled again. Since the uploading operation may take a long time, method upload must operate asynchronously w.r.t. the caller (i.e., using a separate thread). 2.)In TinyOS write a module MaxRead that uses and implements the Read<uint16_t> interface. When requested to read a value from its clients, it reads the sensor wired to the Read<uint16_t> interface it uses 10 times (each read being interleaved from the previous one by 20ms) and returns the maximum value read. The following interfaces may help you: interface Timer<precision_tag> { command void startPeriodic(uint32_t dt); command void startOneShot(uint32_t dt);…

Preview

First page of the document.

First page: 2015 09 09