JSR-043: JTAPI-1.4

Package javax.telephony.media.provider

A reference implementation, MediaPeer and MediaProvider developer's toolkit and interoperability framework for the media package.

See:
          Description

Interface Summary
Dispatcher.DispatchableEvent Supplies a method to dispatch an object to its Listener.
Dispatcher.ExceptionHandler Supplies a method to handle Exceptions generated while dispatching.
MediaPeer How a MediaService finds and initializes a MediaProvider/GroupProvider.
MPI Media Provider Interfaces.
MPI.GroupProvider The MPI definition of a GroupProvider.
MPI.MediaGroup The MPI definition of a MediaGroup.
MPI.Owner A MediaService implementation (like Base_MediaService) implements this.
MPI.Resource What a Resource needs to fit in this framework.
 

Class Summary
Base Implements all flavors of Async Events.
Base_ASREvent Defines the dispatch and accessor methods for ASR Events.
Base_ContainerService Generic code that is independent of the protocol/implementation layer.
Base_MediaConnectionEvent Minimal or reference implementation of MediaConnectionEvent.
Base_MediaConnectionEvent.Token A minimal structure to implement a MediaConnection.Token.
Base_MediaService Reference implementation of MediaService.
Base_Owner A class that owns an EventQueue, and is an MPI.Owner to DispatchableEvents.
Base_PlayerEvent Base_PlayerEvent defines the methods used by Player Events.
Base_RecorderEvent Base_RecorderEvent defines the methods used by RecorderEvent.
Base_Resource a Generic Resource.
Base_SignalDetectorEvent Base_SignalDetectorEvent defines the methods used by SignalDetectorEvent/AsyncSignalDetectorEvent.
Base_SignalGeneratorEvent Base_SignalGeneratorEvent defines the methods used by SignalGeneratorEvent.
Base.BindAndReleaseEvent  
Base.BindEvent Completion Event for the bind methods.
Base.BindToCallEvent Completion Event for bindToCall method.
Base.DelegatedEvent Specialization of MediaServiceEvent for ev_Delegated.
Base.DelegationEvent Implements DelegationEvent and Async.DelegationEvent
Base.DisconnectedEvent The MediaEvent delivered to MediaServiceListener.
Base.Event Implement a base class for Async.Event and MediaEvent.
Base.MediaGroupEvent Base class of completion events for Async.MediaService methods.
Base.MediaServiceEvent Base class for other Events; implements MediaServiceEvent.getMediaService().
Base.ReleaseEvent A release event with no documented exceptions.
Base.ResourceEvent base class for all Async_ResourceEvent classes.
Dispatcher Provides a framework for managing Listeners, and building event queues and dispatch threads.
EventQueue Establish a rendevous for event delivery and dispatch.
NullGroupProvider A GroupProvider implementation.
NullMediaGroup A MediaGroup implementation.
NullMediaPeer A minimal stub implementation that provides a NullGroupProvider.
Request Represents an API method request on a MediaGroup.
S200_ASREvent Defines the accessor methods used by S.200 ASR Events.
S200_PlayerEvent Base_PlayerEvent defines the methods used by Player Events.
S200_RecorderEvent S200_RecorderEvent extends Base_RecorderEvent to extract info from an S.200 Payload.
S200_SignalDetectorEvent S200_SignalDetectorEvent extends Base_SignalDetectorEvent to extract info from an S.200 Payload.
S200_SignalGeneratorEvent S200_SignalGeneratorEvent defines the methods used by SignalGeneratorEvent.
Signals some static stuff for handling SignalGenerator and SignalDetector.
 

Exception Summary
Base.Event.SyncInterruptedException Thown when waitForEventDone() is interrupted by another Thread.
 

Package javax.telephony.media.provider Description

A reference implementation, MediaPeer and MediaProvider developer's toolkit and interoperability framework for the media package.

Package Overview

The provider package is not part of the media package Application Programmer's Interface (API). This package is included to help platform vendors develop compatible and interoperable MediaPeer and MediProvider objects.

To obtain source or binary implemetation of the provider package contact the JSR-043 spec lead.

The provider package defines interfaces for interoperability between the standard MediaService object [BasicMediaService], and a vendor-specific implementation. As a reference implementation, the provider package (in particular Base.Event and Base_MediaService) defines the relationships and sequencing for bind and release, synch/async event management, add/remove Listeners and dispatching of events to the appropriate Listener.

provider.Base.Event is a reference implementation of Async.Event [and its subclasses]. Base.Event is integrated with the EventQueue and Dispatcher classes that manage Listeners and asynchronous Event dispatching.

The interface from the provider package framework to the vendor-specific or platform-specific code is defined by the "Media Provider's Interface" (MPI). To use the provider package, the MPI and its sub-interfaces must be implemented by a vendor's platform-specific code.

Base_MediaService defines the operational relationship between the API (the standard BasicMediaService class) and the MPI.

MPI defines the interface between the components of the provider package [Base_MediaService, Events, Dispatcher, Request, etc.] and the vendor supplied objects: MPI.MediaPeer, MPI.GroupProvider, MPI.MediaGroup, and MPI.Resource. The other MPI interface (MPI.Owner) is implemented by Base_MediaService.

Stub implementations of the vendor specific code are provided as: NullMediaPeer, NullGroupProvider, NullMediaGroup. A vendor can extend these classes to build a working system.

[Sorry, there is not yet a NullResource, that would get into the Resource SPI... @see ECTF-S.300 ]

Base.Event and its sub-classes provides a reference implementation of the Async.Event interfaces. Base.Event works with the MPI.Owner interface as implemented by Base_MediaService. That implementation uses the EventQueue and Dispatcher mechanisms to allow Base.Events to dispatch themselves to the appropriate Listeners.

Dispatcher implements the addListener and removeListener methods, and defines a framework for queues and threads to handle asynchronous event processing.

Provider Package

Base_MediaService

Base_MediaService is the key to everything, and it is largely machine generated code that passes API calls coming from the BasicMediaService to the MediaGroup or the GroupProvider (via the MPI).

The Base_MediaService implementation contains code to handle events and holds the GroupProvider and the currently bound MediaGroup. That is, Base_MediaService implements the record-keeping for bind and release.

MediaProvider

The GroupProvider is obtained from the associated MediaProvider (specified by name or value in the Base_MediaService constructor). A Base_MediaService object is associated with a MediaProvider (by name or by value) when the Base_MediaService object is created.

How and where one gets a MediaProvider is intentionally vague. The simplest is to use the JtapiPeerFactory to get a JtapiPeer, and from there use getProvider(...). If that Provider implements MediaProvider, it can be used directly. Alternatively, the default Base_MediaService object will use "system properties" to find the name of a MediaProvider implementation class. You can override the system property values by supplying the name and "login" arguments directly to the BasicMediaService constructor.

A MediaProvider supplies a "GroupProvider" (the agency responsible for handling bind/release requests; the S.410 abstraction of the SCR).

The GroupProvider handles bind requests by delivering instances of a MediaGroup to the MediaService object [in Base_MediaService]. That constitutes the "binding" of the MediaService to that MediaGroup.

The various Media objects can be distinguished by their cardinality: the collection of Providers (of a given JTAPIPeer) for one or more actual "servers" could have *one* GroupProvider; each telephony media stream (a CCR in S.100) would be associated with a MediaGroup; and a MediaGroup can be passed among a series of MediaService objects

Other methods

After binding, API method invocations on the BasicMediaService are passed to the MediaGroup and MediaEvents are returned. The MediaEvent (a Base.Event) contains the synchronizing info, status, "out" values, and any Exceptions generated in the implementation thread.

Note: the Exceptions are passed as data elements of the MediaEvent, and are only "thrown" if the API layer (BasicMediaService) invoked the operation as a synchronous call.

The "Request" object allows arbitrary [Resource] methods to be passed from the API (BasicMediaService) to the implementation (whever implements the Resource inteface) without the middleware (Base_MediaService) knowing about that method. [and without the API knowing about the Resource implementation object] In effect, Base_MediaService acts as an aggregator for all the MPI.Resource objects and their interfaces.

Events, Listeners and dispatch

All the events are implemented in Base.java. Base.Event is designed to work with the Dispatcher and EventQueue supplied in the provider package. Events in this scheme are "self-dispatching";

The Dispatcher sends Events to the correct Listener as follows:

For each Listener on the Base_MediaService, the Event is told: "here is a Listener, if the Listener should be informed about you (this Event), then take care of it". Each Event has a "dispatch(Listener)" method that checks the type of the Listener, and if the Listener supports this Event's interface, dispatch invokes the appropriate Listener callback method.

Thus, the EventQueue/Dispatcher don't need to know how or where to send the event; each Event is specialized with a dispatch method to test for its Listener, and invoke the documented callback method.


JSR-043: JTAPI-1.4

Send comments to: JSR-43@ectf.org