JSR-043: JTAPI-1.4

javax.telephony
Class JtapiPeerFactory

java.lang.Object
  |
  +--javax.telephony.JtapiPeerFactory

public class JtapiPeerFactory
extends java.lang.Object

The JtapiPeerFactory class is a class by which applications obtain a Provider object.

Introduction

Applications use this class to first obtain a class which implements the JtapiPeer interface. The JtapiPeer interface represents a particular vendor's implementation of JTAPI. The term 'peer' is Java nomenclature for "a particular platform-specific implementation of a Java interface or API". This term has the same meaning for the Java Telephony API. Applications are not permitted to create an instance of the JtapiPeerFactory class. Through an installation procedure provided by each implementator, a JtapiPeer class is made available to an application environment. When applications have a JtapiPeer object for a particular platform-dependent implementation, they may obtain a Provider object via that interface. The details of that interface are discussed in the specification for the JtapiPeer interface.

Obtaining a JtapiPeer Object

Applications use the JtapiPeerFactory.getJtapiPeer() method to obtain a JtapiPeer object. The argument to this method is a classname which represents an object which implements the JtapiPeer interface. This object and the classname under which it can be found must be supplied by the vendor of the implementation. Note that this object is not a Provider, however, this interface is used to obtain Provider objects from that particular implementation.

The Java Telephony API places conventions on vendors on the classname they use for their JtapiPeer object. This class name must begin with the domain name assigned to the vendor in reverse order. Because the space of domain names is managed, this scheme ensures that collisions between two different vendor's implementations will not happen. For example, an implementation from Sun Microsystem's will have "com.sun" as the prefix to its JtapiPeer class. After the reversed domain name, vendors are free to choose any class hierarchy they desire.

Default JtapiPeer

Additionally, the vendor providing the JtapiPeer class may supply a a DefaultJtapiPeer.class class file. When placed in the classpath of applications, this class (which must implement the JtapiPeer interface) becomes the default JtapiPeer object returned by the JtapiPeerFactory.getJtapiPeer() method. By convention the default class name must be DefaultJtapiPeer.

In basic environments, applications and users do not want the burden of finding out the class name in order to use a particular implementation. Therefore, the JtapiPeerFactory class supports a mechanism for applications to obtain the default implementation for their system. If applications use a null argument to the JtapiPeerFactory.getJtapiPeer() method, they will be returned the default installed implementation on their system if it exists.

Note: It is the responsibility of implementation vendors to supply a version of a DefaultJtapiPeer or some means to alias their peer implementation along with a means to place that DefaultJtapiPeer class in the application classpath.

See Also:
JtapiPeer

Method Summary
static JtapiPeer getJtapiPeer(java.lang.String jtapiPeerName)
          Returns an instance of a JtapiPeer object given a fully qualified classname of the class which implements the JtapiPeer object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getJtapiPeer

public static JtapiPeer getJtapiPeer(java.lang.String jtapiPeerName)
                              throws JtapiPeerUnavailableException
Returns an instance of a JtapiPeer object given a fully qualified classname of the class which implements the JtapiPeer object.

If no classname is provided (null), a default class named DefaultJtapiPeer is chosen as the classname to load. If it does not exist or is not installed in the CLASSPATH as the default, a JtapiPeerUnavailableException exception is thrown.

Parameters:
jtapiPeerName - The classname of the JtapiPeer object class.
Returns:
An instance of the JtapiPeer object.
Throws:
JtapiPeerUnavailableException - Indicates that the JtapiPeer specified by the classname is not available.

JSR-043: JTAPI-1.4

Send comments to: JSR-43@ectf.org