Java Doc for SipFactory.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » sip » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » Java Advanced Imaging » javax.sip 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.sip.SipFactory

SipFactory
public class SipFactory (Code)
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





Method Summary
public  AddressFactorycreateAddressFactory()
     Creates an instance of the AddressFactory implementation.
public  HeaderFactorycreateHeaderFactory()
     Creates an instance of the HeaderFactory implementation.
public  MessageFactorycreateMessageFactory()
     Creates an instance of the MessageFactory implementation.
public synchronized  SipStackcreateSipStack(Properties properties)
     Creates an instance of a SipStack implementation based on the configuration properties object passed to this method.
public static synchronized  SipFactorygetInstance()
     Returns an instance of a SipFactory.
public  StringgetPathName()
     Returns the current pathname of the SipFactory.
public  voidresetFactory()
     This method reset's the SipFactory's references to the object's it has created.
public  voidsetPathName(String pathName)
     Sets the pathname that identifies the location of a particular vendor's implementation of this specification.



Method Detail
createAddressFactory
public AddressFactory createAddressFactory() throws PeerUnavailableException(Code)
Creates an instance of the AddressFactory implementation. This method ensures that only one instance of an AddressFactory is returned to the application, no matter how often this method is called.
throws:
  PeerUnavailableException - if peer class could not be found



createHeaderFactory
public HeaderFactory createHeaderFactory() throws PeerUnavailableException(Code)
Creates an instance of the HeaderFactory implementation. This method ensures that only one instance of a HeaderFactory is returned to the application, no matter how often this method is called.
throws:
  PeerUnavailableException - if peer class could not be found



createMessageFactory
public MessageFactory createMessageFactory() throws PeerUnavailableException(Code)
Creates an instance of the MessageFactory implementation. This method ensures that only one instance of a MessageFactory is returned to the application, no matter how often this method is called.
throws:
  PeerUnavailableException - if peer class could not be found



createSipStack
public synchronized SipStack createSipStack(Properties properties) throws PeerUnavailableException(Code)
Creates an instance of a SipStack implementation based on the configuration properties object passed to this method. The recommended behaviour is to not specify an "javax.sip.IP_ADDRESS" property in the Properties argument, in this case the "javax.sip.STACK_NAME" uniquely identifies the stack. A new stack instance will be returned for each different stack name associated with a specific vendor implementation. The ListeningPoint is used to configure the IP Address argument. For backwards compatability, if a "javax.sip.IP_ADDRESS" is supplied, this method ensures that only one instance of a SipStack is returned to the application for that IP Address, independent of the number of times this method is called. Different SipStack instances are returned for each different IP address.

See SipStack for the expected format of the properties argument.
throws:
  PeerUnavailableException - if the peer class could not be found




getInstance
public static synchronized SipFactory getInstance()(Code)
Returns an instance of a SipFactory. This is a singleton class so this method is the global access point for the SipFactory. the single instance of this singleton SipFactory



getPathName
public String getPathName()(Code)
Returns the current pathname of the SipFactory. The pathname identifies the location of a particular vendor's implementation of this specification as defined the naming convention. The pathname must be the reverse domain name assigned to the vendor providing this implementation. This value is defaulted to gov.nist the location of the Reference Implementation. the string identifying the current vendor implementation.



resetFactory
public void resetFactory()(Code)
This method reset's the SipFactory's references to the object's it has created. It allows these objects to be garbage collected assuming the application no longer holds references to them. This method must be called to reset the factories references to a specific vendors implementation of this specification before it creates another vendors implementation of this specification by changing the pathname of the SipFactory.



setPathName
public void setPathName(String pathName)(Code)
Sets the pathname that identifies the location of a particular vendor's implementation of this specification. The pathname must be the reverse domain name assigned to the vendor providing the implementation. An application must call SipFactory.resetFactory before changing between different implementations of this specification.
Parameters:
  pathName - -the reverse domain name of the vendor, e.g. Sun Microsystem'swould be 'com.sun'



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.