The SipFactory is a singleton class which applications can use a single
access point to obtain proprietary implementations of this specification. As
the SipFactory is a singleton class there will only ever be one instance of
the SipFactory. The single instance of the SipFactory can be obtained using
the
SipFactory.getInstance method. If an instance of the SipFactory
already exists it will be returned to the application, otherwise a new
instance will be created. A peer implementation object can be obtained from
the SipFactory by invoking the appropriate create method on the SipFactory
e.g. to create a peer SipStack, an application would invoke the
SipFactory.createSipStack(Properties) method.
Naming Convention
Note that the SipFactory utilises a naming convention defined by this
specification to identify the location of proprietary objects that implement
this specification. The naming convention is defined as follows:
- The upper-level package structure referred to by the SipFactory
with the attribute pathname can be used to differentiate between
proprietary implementations from different SIP stack vendors. The
pathname used by each SIP vendor must be the domain name
assigned to that vendor in reverse order. For example, the pathname used by
Sun Microsystem's would be
com.sun .
- The lower-level package structure and classname of a peer object
is also mandated by this specification. The lowel-level package must be
identical to the package structure defined by this specification and the
classname is mandated to the interface name appended with the
Impl post-fix. For example, the lower-level package structure
and classname of a proprietary implementation of the
javax.sip.SipStack interface must be
javax.sip.SipStackImpl .
Using this naming convention the SipFactory can locate a vendor's
implementation of this specification without requiring an application to
supply a user defined string to each create method in the SipFactory. Instead
an application merely needs to identify the vendors SIP implementation it
would like to use by setting the pathname of that vendors implementation.
It follows that a proprietary implementation of a peer object of this
specification can be located at:
'pathname'.'lower-level package structure and classname'.
For example an application can use the SipFactory to instantiate a NIST
peer SipStack object by setting the pathname to
gov.nist and calling the createSipStack method. The SipFactory
would return a new instance of the SipStack object at the following location:
gov.nist.javax.sip.SipStackImpl.java Because the space of
domain names is managed, this scheme ensures that collisions between two
different vendor's implementations will not happen. For example: a different
vendor with a domain name 'bea.com' would have their peer SipStack object
located at com.bea.javax.sip.SipStackImpl.java .
Default Namespace:
This specification defines a default namespace for the SipFactory, this
namespace is the location of the Reference Implementation. The default
namespace is gov.nist the author of the Reference
Implementation, therefore the pathname will have the initial
value of gov.nist for a new instance of the SipFactory. An
application must set the pathname of the SipFactory on retrieval
of a new instance of the factory in order to use a different vendors SIP
stack from that of the Reference Implementation. An application can not mix
different vendor's peer implementation objects.
author: BEA Systems, NIST version: 1.2 |