public class SipFactory extends Object
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
android.javax.sip.SipStack
interface must be
android.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 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:
android.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.
Modifier and Type | Method and Description |
---|---|
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(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.
|
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(String pathName)
Sets the pathname that identifies the location of a
particular vendor's implementation of this specification.
|
public static SipFactory getInstance()
public SipStack createSipStack(Properties properties) throws PeerUnavailableException
See 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(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 String getPathName()
gov.nist
the location of the Reference Implementation.public void resetFactory()
Copyright © 2016. All Rights Reserved.