Back to Trading Service Examples Page Back

Trading Example: Video on Demand

Description

The Video on Demand example demonstrates of how to use the basic features of Trading Service. Features which are covered include:

The Video-On-Demand example consists of:

Video feed providers use the Trading Service to advertise their services to potential clients: clients use the Trading Service to locate the (previously advertised) video feeds that they want. A TV Company defines the types of service that the video feed providers can offer.

The following diagram shows the Video-on-Demand's architecture:

Trading Service Video example

Source Files

The source files for the Video on Demand example are:

Video.idl - the IDL interface for the video feed objects. A Programme interface defines an attribute "title" and a show operation. The Film and SportsEvent interfaces both extend the Programme interface. The Film interface adds the attribute certificate"; the SportsEvent interface adds the attribute "sport".

TradingUtil.java - provides methods that resolve the Trading Service and obtain references to some of the components of the Trading Service. The class' methods are:

FilmImpl.java - implements the Film interface in Video.idl. The methods of this class are:

SportsEventImpl.java - implements the SportsEventImpl interface from Video.idl. The methods of this class are:

VideoMachine.java - a server that supplies video feeds. Its methods are:

TVCompany.java - adds the service types to the Trading Service. Is methods are:

TVSet.java - represents a television set that can request a video feed. Its methods are:

ProgrammeFactory.java - a server that can provide video feeds which are identical to those provided by the VideoMachine class above, except that the video feeds are not created until they are required. This class is a Lookup object. Its methods are:

All other methods of this class are provided so that the class conforms to the Lookup interface; they are not used in the manipulation of the proxy offer.

How To Run This Example

If using an ORB which requires persistent POAs to be registered before they can be activated, ensure that that the OpenFusion.TradingTVCompany, OpenFusion.TradingVideoMachine, and OpenFusion.TradingTVSet POAs are registered.

  1. Start the Trading Service from the command line or by using the Administration Manager.

    From the command line use:

    server -start TradingService

    Using the Administration Manager:

    Start the Administration Manager, right click on the TradingService node and select Start from the pop-up menu.

  2. After starting the Trading Service, the TVCompany should be started first to add the service types to the Trading Service:
    run com.prismt.cos.CosTrading.examples.Video.TVCompany
  3. Start one or more VideoMachines to export offers of video feeds to the Trading Service:
    run com.prismt.cos.CosTrading.examples.Video.VideoMachine
  4. Finally, in a new window, TVSets are used to request video feeds. (some programmes may not be available, depending on whether they were exported to the Trading Service in step 2):
    run com.prismt.cos.CosTrading.examples.Video.TVSet


PrismTech TOP
Top