|
JAIN SIP API v1.1 - 23rd June 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.sip.SipFactory
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 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
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:
com.sun
.
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
.
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 Sun
Microsystems's peer SipStack object by setting the pathname to
com.sun
and calling the createSipStack method. The SipFactory
would return a new instance of the SipStack object at the following
location: com.sun.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 'foo.com' would have
their peer SipStack object located at com.foo.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.
Method Summary | |
AddressFactory |
createAddressFactory()
Creates an instance of the AddressFactory implementation. |
HeaderFactory |
createHeaderFactory()
Creates an instance of the HeaderFactory implementation. |
MessageFactory |
createMessageFactory()
Creates an instance of the MessageFactory implementation. |
SipStack |
createSipStack(java.util.Properties properties)
Creates an instance of a SipStack implementation based on the configuration properties object passed to this method. |
static SipFactory |
getInstance()
Returns an instance of a SipFactory. |
java.lang.String |
getPathName()
Returns the current pathname of the SipFactory. |
void |
resetFactory()
This method reset's the SipFactory's references to the object's it has created. |
void |
setPathName(java.lang.String pathName)
Sets the pathname that identifies the location of a particular vendor's implementation of this specification. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static SipFactory getInstance()
public SipStack createSipStack(java.util.Properties properties) throws PeerUnavailableException
SipStack
for the expected
format of the properties
argument.
PeerUnavailableException
- if the peer class could not be foundpublic MessageFactory createMessageFactory() throws PeerUnavailableException
PeerUnavailableException
- if peer class could not be foundpublic HeaderFactory createHeaderFactory() throws PeerUnavailableException
PeerUnavailableException
- if peer class could not be foundpublic AddressFactory createAddressFactory() throws PeerUnavailableException
PeerUnavailableException
- if peer class could not be foundpublic void setPathName(java.lang.String pathName)
resetFactory()
before changing between different
implementations of this specification.
pathName
- - the reverse domain name of the vendor, e.g. Sun
Microsystem's would be 'com.sun'public java.lang.String getPathName()
gov.nist
the location of the Reference Implementation.
public void resetFactory()
|
JAIN SIP API v1.1 - 23rd June 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |