JAINTM MGCP API (DRAFT FOR PUBLIC REVIEW) - Version 0.9 - 16 NOVEMBER 2000

jain.protocol.ip
Class JainIPFactory

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--jain.protocol.ip.JainIPFactory

public class JainIPFactory
extends java.lang.ClassLoader

The JAIN IP Factory is a class through which applications obtain a proprietary (Peer) JAIN IP Stack Object. The createObject method of this class provides this capability. To use this method, the Path Name must first be set to indicate which specific vendor's implementation should be used for instantiating the JAIN IP Stack Object. For example, Sun Microsystem's implementation would be identified by the Path Name "com.sun". Then, the Class Name for the Peer Object you would like to create must be supplied. For example, the Class Name for a JainMgcpStack Object would be "jain.protocol.ip.mgcp.JainMgcpStackImpl".

It should be noted that any object that implements the:

JainXXXXStack interface - is referred to as JainXXXXStackImpl
JainXXXXProvider interface - is referred to as JainXXXXProviderImpl

where "XXXX" identifies a specific JAIN IP protocol; e.g., "XXXX" = "Mgcp" for the Media Gateway Control Protocol (MGCP).

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 JAIN IP API specifications. Applications are not permitted to create an instance of the JainIPFactory class. Through an installation procedure provided by each implementor, a 'Peer JAIN IP' class is made available to an application environment. When applications have instantiated a Peer JAIN IP Stack Object for a particular platform-dependent implementation, they may obtain a JAIN IP Provider object via the interface implemented by the Stack object.

The JAIN IP API specifications restrict the Path Name each vendor uses and rely on the conventions used for managing package names. The 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 implementations will not happen. For example, an implementation from Sun Microsystems, Inc. will have "com.sun" as the prefix to its Peer's Class Names; i.e., JainMgcpStackImpl would be fully qualified by 'com.sun.jain.protocol.ip.mgcp.JainMgcpStackImpl'.


Method Summary
 java.lang.Object createIPObject(java.lang.String objectClassName)
          Returns an instance of a Peer JAIN IP Object, given the Class Name of the class for which the object is being instantiated.
protected  java.lang.Class findClass(java.lang.String fqClassName)
          This method locates, loads, and defines the desired class.
static JainIPFactory getInstance()
          Returns an instance of a JainIPFactory.
 java.util.Vector getJainIPObject()
          Returns a vector of Peer JAIN IP Objects that have been created by this instance of the JAIN IP Factory.
 java.lang.String getPathName()
          The Path Name specifies where the JainIPFactory can find a specific vendor's implementation of the JAIN IP API specification for the factory to instantiate the objects using the createIPObject method.
 void setPathName(java.lang.String pathName)
          The Path Name specifies where the JainIPFactory can find a specific vendor's implementation of the JAIN IP API specification for the factory to instantiate the objects using the createIPObject method.
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createIPObject

public java.lang.Object createIPObject(java.lang.String objectClassName)
                                throws IPPeerUnavailableException
Returns an instance of a Peer JAIN IP Object, given the Class Name of the class for which the object is being instantiated. An example of a Class Name is "jain.protocol.ip.mgcp.JainMgcpStackImpl".

Proprietary implementations must adhere to the following naming convention: a class that implements a JAIN IP API interface with the name "InterfaceName" must be named "InterfaceNameImpl". For example, a vendor implementation of the JainMgcpStack interface must be called "JainMgcpStackImpl".

The "PathName" must be set before invoking this method, so that the correct proprietary implementation will be used in the instantiation. If not set explicitly, "PathName" will be set to "com.sun".

Parameters:
objectClassName - The Class Name of the object to be instantiated.
Throws:
IPPeerUnavailableException - If the specified class does not exist or is not installed in the CLASSPATH, an IPPeerUnavailableException exception is thrown.

findClass

protected java.lang.Class findClass(java.lang.String fqClassName)
                             throws java.lang.ClassNotFoundException
This method locates, loads, and defines the desired class. It is a protected method intended only for the use of the createIPObject method of the JainIPFactory.
Overrides:
findClass in class java.lang.ClassLoader
Parameters:
fqClassName - The fully-qualified name of the class, formed of the stored path name and the objectClassName that was passed as a parameter to the createIPObject method, joined by a "." character.

getInstance

public static JainIPFactory getInstance()
Returns an instance of a JainIPFactory. This is a singleton-type class, so this method is the only way to access it. Note that this method is static.

getJainIPObject

public java.util.Vector getJainIPObject()
Returns a vector of Peer JAIN IP Objects that have been created by this instance of the JAIN IP Factory.

Returns:
A vector of Peer JAIN IP Objects.

getPathName

public java.lang.String getPathName()
The Path Name specifies where the JainIPFactory can find a specific vendor's implementation of the JAIN IP API specification for the factory to instantiate the objects using the createIPObject method. The 'pathName' string will take the form 'com.CompanyName'. The default pathName that will be returned if none was set is 'com.sun'. 'pathName' will be all lower case.

Returns:
The Path Name as a string.

setPathName

public void setPathName(java.lang.String pathName)
The Path Name specifies where the JainIPFactory can find a specific vendor's implementation of the JAIN IP API specification for the factory to instantiate the objects using the createIPObject method.

Parameters:
pathName - The 'pathName' string must take the form 'com.CompanyName'. The default pathName is 'com.sun'. The stored path name will be forced to lower case.

JAINTM MGCP API (DRAFT FOR PUBLIC REVIEW) - Version 0.9 - 16 NOVEMBER 2000

Copyright © 2000 Sun Microsystems, Inc.