edu.rit.slides
Interface Screen

All Known Implementing Classes:
ScreenObject

public interface Screen

Interface Screen is the remote interface for an exported screen object in the Slides application.

A group of one or more screen objects is attached to a multihandle for interface Screen; this group of screen objects is called a theatre. Using the multihandle, a client can invoke methods on all screens in the theatre. The client is typically a Projector object.

The screen objects and the projector objects interact as follows. A projector object repeatedly calls availableSlides() on a Screen multihandle to tell all screen objects in the theatre which slides the projector object has available. In response, the screen objects start calling getSlide() on the projector object to get the individual slides one at a time.

If no availableSlides() method call arrives from a certain projector within a certain leasetime (for example, leasetime = 30 seconds), the screen objects conclude that the projector object has gone away, and the screen objects discard the slides they had obtained from that projector object. To avoid correlated broadcasts, each projector object calls availableSlides() at intervals chosen at random in the range (0.2 leasetime) to (0.4 leasetime) (for example, 6 to 12 seconds). Thus, a screen object should receive at least two availableSlides() method calls from a projector object before timing out. This lets the screen objects tolerate the occasional loss of one availableSlides() method call.

A screen object calls getSlide() on a projector object's unihandle to get a certain slide. In response, the projector object calls putSlide() on a Screen multihandle to send the slide to all screens in the theatre.

A projector object repeatedly calls displaySlides() on a Screen multihandle to tell all screens in the theatre to display a particular slide or slides.

If no displaySlides() method call arrives from a certain projector within a certain leasetime (for example, leasetime = 30 seconds), the screen objects conclude that the projector object has gone away, and the screen objects stop displaying the slides from that projector object. To avoid correlated broadcasts, each projector object calls displaySlides() at intervals chosen at random in the range (0.2 leasetime) to (0.4 leasetime) (for example, 6 to 12 seconds). Thus, a screen object should receive at least two displaySlides() method calls from a projector object before timing out. This lets the screen objects tolerate the occasional loss of one displaySlides() method call.

The process of transferring slides from projector objects to screen objects is broken up into separate method calls (availableSlides() -- getSlide() -- putSlide()) to give the screen objects flexibility in when they obtain the slides. A screen object need not obtain all the slides at once. A screen object can obtain slides one at a time as needed. Or, to reduce the latency when displaying a slide, a screen object can obtain slides a few at a time, ahead of time. Obtaining the slides one at a time also lets other network traffic be interleaved with the slide traffic.

The slide itself is not sent as an argument of the displaySlides() method to reduce the latency when displaying a slide or slides. The intent is that the screen object would already have obtained the slides in response to an earlier availableSlides() method call. The screen object can then display the slides immediately, without having to wait for the slides to come across the network. Of course, if the screen object does not have the specified slides, the screen object will have to ask the projector object to send them (getSlide()) and wait for the slides to arrive (putSlide()) before the screen object can display them.


Field Summary
static int LEASE_TIME
          Lease time in milliseconds, 30000 msec (30 sec).
 
Method Summary
 void availableSlides(Projector theProjector, Eoid[] theSlideIDs)
          Notify this screen that a projector has the given slides available.
 void displaySlides(Projector theProjector, Eoid[] theSlideIDs)
          Display the given slides on this screen.
 void putSlide(Projector theProjector, Eoid theSlideID, Slide theSlide)
          Provide a slide from the given projector to this screen.
 

Field Detail

LEASE_TIME

static final int LEASE_TIME
Lease time in milliseconds, 30000 msec (30 sec).

See Also:
Constant Field Values
Method Detail

availableSlides

void availableSlides(Projector theProjector,
                     Eoid[] theSlideIDs)
Notify this screen that a projector has the given slides available. The given array of slide IDs is a complete list of all the slides the projector has available at this time.

Parameters:
theProjector - Unihandle for the projector.
theSlideIDs - Array of zero or more slide IDs (type Eoid) the projector has available.

putSlide

void putSlide(Projector theProjector,
              Eoid theSlideID,
              Slide theSlide)
Provide a slide from the given projector to this screen.

Parameters:
theProjector - Unihandle for the projector.
theSlideID - Slide ID (type Eoid).
theSlide - The slide itself.

displaySlides

void displaySlides(Projector theProjector,
                   Eoid[] theSlideIDs)
Display the given slides on this screen. The given array of slide IDs is a complete list of the slides from the given projector that are to be displayed at this time. Any slides from the given projector that had been displayed are first removed from the display, then the given slides are added to the display.

Parameters:
theProjector - Unihandle for the projector that has the slides.
theSlideIDs - Array of zero or more slide IDs (type Eoid) the projector has available that are to be displayed.


Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.