edu.rit.slides
Class DiscoverableScreenObject

java.lang.Object
  extended by edu.rit.slides.DiscoverableScreenObject
All Implemented Interfaces:
DiscoverableScreen, ScreenDiscovery

public class DiscoverableScreenObject
extends Object
implements DiscoverableScreen

Class DiscoverableScreenObject provides an exported discoverable screen object in the Slides application. A discoverable screen object is a screen object that can be discovered dynamically by other devices. See interface ScreenDiscovery for a description of the screen discovery process.

An instance of class DiscoverableScreenObject performs periodic report() method invocations and handles request() method invocations on behalf of a certain theatre. The theatre is specified by a multihandle for interface Screen.


Field Summary
 
Fields inherited from interface edu.rit.slides.ScreenDiscovery
LEASE_TIME
 
Constructor Summary
DiscoverableScreenObject()
          Construct a new discoverable screen object.
 
Method Summary
 void associate(Screen theHandle, String theName)
          Associate this discoverable screen object with the given theatre.
 void report(Screen theHandle, String theName)
          Report that a theatre exists.
 void request()
          Request that theatres report their presence quickly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoverableScreenObject

public DiscoverableScreenObject()
Construct a new discoverable screen object. The object is exported to the M2MI Layer so it can receive invocations on an omnihandle for interface ScreenDiscovery or interface DiscoverableScreen. Initially, this discoverable screen object is not associated with a theatre.

Method Detail

associate

public void associate(Screen theHandle,
                      String theName)
Associate this discoverable screen object with the given theatre. If theHandle is not null, it must be the Screen multihandle for the theatre, and this discoverable screen object starts reporting that theatre's presence. If theHandle is null, this discoverable screen object stops reporting the theatre's presence.

Parameters:
theHandle - The Screen multihandle used for performing method calls on all screen objects in the theatre.
theName - Theatre name.
Throws:
NullPointerException - (unchecked exception) Thrown if theHandle is not null and theName is null.

report

public void report(Screen theHandle,
                   String theName)
Report that a theatre exists.

Specified by:
report in interface ScreenDiscovery
Parameters:
theHandle - The Screen multihandle used for performing method calls on all screen objects in the theatre.
theName - Theatre name.

request

public void request()
Request that theatres report their presence quickly.

Specified by:
request in interface DiscoverableScreen


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