Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Let us now look a bit more in detail at the way these classes and interfaces are used. As we said, first of all, the application needs to get a reference to an instance of the SipFactory. We will use the static getInstance() method for that. Then we need to get an instance of SipStack, by invoking the createSipStack() method on the SipFactory. This method takes a Properties object as an argument that contains the configuration for the SIP implementation (e.g, stack name, retransmission behavior, etc.). Table 8.2 shows the methods in SipFactory.
| SipFactory Methods | 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. |
| SipFactory | getInstance() | Returns an instance of a SipFactory. |
| String | getPathName() | Returns the current pathname of the SipFactory. |
| Void | resetFactory() | Resets the SipFactory’s references to the objects it has created. |
| Void | setPathName (String pathname) | Sets the pathname that identifies the location of a particular vendor’s implementation of this specification. |