Source Code Cross Referenced for ProtocolObjects.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » examples » cancel » 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 » examples.cancel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package examples.cancel;
02:
03:        import java.util.Properties;
04:
05:        import javax.sip.PeerUnavailableException;
06:        import javax.sip.SipException;
07:        import javax.sip.SipFactory;
08:        import javax.sip.SipStack;
09:        import javax.sip.address.AddressFactory;
10:        import javax.sip.header.HeaderFactory;
11:        import javax.sip.message.MessageFactory;
12:
13:        /**
14:         * @author M. Ranganathan
15:         *
16:         */
17:        public class ProtocolObjects {
18:            static AddressFactory addressFactory;
19:
20:            static MessageFactory messageFactory;
21:
22:            static HeaderFactory headerFactory;
23:
24:            static SipStack sipStack;
25:
26:            static int logLevel = 32;
27:
28:            static String logFileDirectory = "logs/";
29:
30:            static void init(String stackname) {
31:                SipFactory sipFactory = null;
32:
33:                sipFactory = SipFactory.getInstance();
34:                sipFactory.setPathName("gov.nist");
35:                Properties properties = new Properties();
36:                // If you want to try TCP transport change the following to
37:
38:                // If you want to use UDP then uncomment this.
39:                properties.setProperty("javax.sip.STACK_NAME", stackname);
40:
41:                // The following properties are specific to nist-sip
42:                // and are not necessarily part of any other jain-sip
43:                // implementation.
44:                properties.setProperty("gov.nist.javax.sip.DEBUG_LOG",
45:                        logFileDirectory + stackname + "debug.txt");
46:                properties.setProperty("gov.nist.javax.sip.SERVER_LOG",
47:                        logFileDirectory + stackname + "log.txt");
48:
49:                // Set to 0 in your production code for max speed.
50:                // You need 16 for logging traces. 32 for debug + traces.
51:                // Your code will limp at 32 but it is best for debugging.
52:                properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL",
53:                        new Integer(logLevel).toString());
54:
55:                try {
56:                    // Create SipStack object
57:                    sipStack = sipFactory.createSipStack(properties);
58:
59:                    System.out.println("createSipStack " + sipStack);
60:                } catch (Exception e) {
61:                    // could not find
62:                    // gov.nist.jain.protocol.ip.sip.SipStackImpl
63:                    // in the classpath
64:                    e.printStackTrace();
65:                    System.err.println(e.getMessage());
66:                    throw new RuntimeException("Stack failed to initialize");
67:                }
68:
69:                try {
70:                    headerFactory = sipFactory.createHeaderFactory();
71:                    addressFactory = sipFactory.createAddressFactory();
72:                    messageFactory = sipFactory.createMessageFactory();
73:                } catch (SipException ex) {
74:                    ex.printStackTrace();
75:                    throw new RuntimeException(ex);
76:                }
77:            }
78:
79:            public static void destroy() {
80:                sipStack.stop();
81:            }
82:
83:            public static void start() throws Exception {
84:                sipStack.start();
85:
86:            }
87:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.