JCC
v0.9.2

jain.application.services.jcp
Class JcpPeerFactory

java.lang.Object
  |
  +--jain.application.services.jcp.JcpPeerFactory

public class JcpPeerFactory
extends java.lang.Object

The JcpPeerFactory class is a class by which applications obtain a JcpProvider object.

Introduction

Applications use this class to first obtain a class which implements the JcpPeer interface. The JcpPeer interface represents a particular vendor's implementation of JCP. 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 Core Package API. Applications are not permitted to create an instance of the JcpPeerFactory class. Through an installation procedure provided by each implementator, a JcpPeer class is made available to an application environment. When applications have a JcpPeer object for a particular platform-dependent implementation, they may obtain a JcpProvider object via that interface. The details of that interface are discussed in the specification for the JcpPeer interface.

Obtaining a JcpPeer Object

Applications use the getJcpPeer(String) method to obtain a JcpPeer object. The argument to this method is a classname which represents an object which implements the JcpPeer 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 JcpProvider, however, this interface is used to obtain JcpProvider objects from that particular implementation.

The JCP places conventions on vendors on the classname they use for their JcpPeer 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 JcpPeer class. After the reversed domain name, vendors are free to choose any class hierarchy they desire.

Default JcpPeer

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

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 JcpPeerFactory class supports a mechanism for applications to obtain the default implementation for their system. If applications use a null argument to the getJcpPeer(String) 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 DefaultJcpPeer or some means to alias their peer implementation along with a means to place that DefaultJcpPeer class in the application classpath.


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

Method Detail

getJcpPeer

public static JcpPeer getJcpPeer(java.lang.String jcpPeerName)
                          throws java.lang.ClassNotFoundException
Returns an instance of a JcpPeer object given a fully qualified classname of the class which implements the JcpPeer object.

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

Parameters:
jcpPeerName - The classname of the JcpPeer object class.
Returns:
An instance of the JcpPeer object.
Throws:
java.lang.ClassNotFoundException - Indicates that the JcpPeer specified by the classname is not available.

JCC
v0.9.2

29 Oct 2000
If you have any comments or queries, please mail them to jcc@research.telcordia.com


Copyright-2000 Sun Microsystems