JCAT
v0.3.1

javax.csapi.cc.jcc
Class JccPeerFactory

java.lang.Object
  extended byjavax.csapi.cc.jcc.JccPeerFactory

public class JccPeerFactory
extends java.lang.Object

The JccPeerFactory class is a class by which applications obtain a JccProvider object.

Introduction

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

Obtaining a JccPeer Object

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

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

Default JccPeer

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

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

Since:
1.0b

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

Method Detail

getJccPeer

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

If no classname is provided (null), a default class named DefaultJccPeer 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:
JccPeerName - The classname of the JccPeer object class.
Returns:
An instance of the JccPeer object.
Throws:
java.lang.ClassNotFoundException - Indicates that the JccPeer specified by the classname is not available.

JCAT
v0.3.1

August, 2003
If you have any comments or queries, please mail them to JSR-122-EG@JCP.ORG

Copyright - 2001, 2003 Sun Microsystems