Source Code Cross Referenced for JnlpMain.java in  » Portal » Open-Portal » com » sun » portal » proxylet » client » jnlp » 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 » Portal » Open Portal » com.sun.portal.proxylet.client.jnlp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.sun.portal.proxylet.client.jnlp;
002:
003:        /**
004:         *Created on Jan 23, 2005
005:         * Sun Microsystems Inc., Copyright 2005
006:         *
007:         * JnlpMain
008:         * Performs JNLP related initializations and invokes the server method
009:         */
010:
011:        /**
012:         * @author Sudha
013:         *
014:         */
015:
016:        import com.sun.portal.proxylet.client.common.Param;
017:        import com.sun.portal.proxylet.client.common.Log;
018:        import com.sun.portal.proxylet.client.common.ValidateSession;
019:        import com.sun.portal.proxylet.client.common.browser.BrowserType;
020:        import com.sun.portal.proxylet.client.common.browser.MozillaEventHandler_JNLP;
021:        import com.sun.portal.proxylet.client.common.ui.ProxyletUI;
022:        import com.sun.portal.proxylet.client.common.ui.AbstractEventHandler;
023:        import com.sun.portal.proxylet.client.common.server.Cookie;
024:
025:        import java.lang.reflect.InvocationTargetException;
026:
027:        public class JnlpMain {
028:
029:            public static void main(String[] args) {
030:                try {
031:                    if (args.length == 0) {
032:                        System.out.println("Missing Arguments");
033:                        System.out
034:                                .println("Expects the following arguments GW_URL followed by SERVLET_URL");
035:                        System.exit(1);
036:                    }
037:
038:                    for (int i = 0; i < args.length; i++) {
039:                        System.out.println("arg[" + i + "] = " + args[i]);
040:                    }
041:
042:                    String gwURL = args[0];
043:                    String servletURL = args[1];
044:                    String cookie = args[2];
045:                    String browser = args[3];
046:                    String bindPort = args[4];
047:                    String bindIP = args[5];
048:                    String gatewayHost = args[6];
049:                    String gatewayPort = args[7];
050:                    String gatewaymode = args[8];
051:                    String rules = args[9];
052:                    String debuglevel = args[10];
053:                    String width = args[11];
054:                    String height = args[12];
055:                    String platformLoginURL = args[13];
056:                    String sessionIdleTimeout = args[14];
057:                    String propertyfile = args[15];
058:
059:                    if (debuglevel != null && debuglevel.equals("1"))
060:                        Log.setloglevel_JavaConsole(true);
061:
062:                    // cleanup previous session proxylet files
063:                    Param.cleanupPreviousSessionsProxyletFiles();
064:
065:                    // initialize Param with values
066:                    Param.setGatewayUrl(gwURL);
067:                    Param.setServletUrl(servletURL);
068:                    Param.setRawCookie(cookie);
069:                    Cookie c = new Cookie(cookie,
070:                            Cookie.APPLETPARAM_COOKIE_FORMAT);
071:                    Param.setCookie(c);
072:                    Param.setBrowserType(BrowserType.getType(browser));
073:                    Param.setBindPort(bindPort);
074:                    Param.setBindIP(bindIP);
075:                    Param.setGatewayHost(gatewayHost);
076:                    Param.setGatewayPort(gatewayPort);
077:                    Param.setGatewayMode(gatewaymode);
078:                    Param.setRules(rules);
079:                    Param.setVMVersion();
080:                    Param.setVendor();
081:                    Param.setSSLProvider();
082:                    Param.setPacfileLoc();
083:                    Param.setSource("App");
084:                    Param.setWindowDimension(Integer.parseInt(width), Integer
085:                            .parseInt(height));
086:                    Param.setPlatformLoginURL(platformLoginURL);
087:                    Param.setSessionIdleTimeout(sessionIdleTimeout);
088:                    Param.setPropertyFile(propertyfile);
089:
090:                    // Check if Proxylet is already running.. if so quit this session
091:                    if (Param.isProxyletRunning()) {
092:                        try {
093:                            Param.sendMsgtoServlet("?command=setJWSLoaded",
094:                                    false, false, null);
095:                        } catch (Exception e) {
096:                            Log
097:                                    .debugu("Unable to update session with JWS status "
098:                                            + e.getMessage());
099:                        }
100:                        Log
101:                                .info(Param
102:                                        .getString("pinfo.7",
103:                                                "Detected another instance of proxylet on this machine \\n Quitting"));
104:
105:                        try {
106:                            // Wait for few seconds for user to read the message
107:                            Thread.sleep(5 * 1000);
108:                        } catch (Exception e) {
109:                        }
110:                        System.exit(1);
111:                    }
112:
113:                    // if rules is not defined , load pac content
114:                    if (Param.getRules() != null
115:                            && Param.getRules().equals("$RULES")) {
116:                        Param.loadPacContent();
117:                    }
118:
119:                    // update the servlet with JWS status as the first thing
120:                    try {
121:                        Param.sendMsgtoServlet("?command=setJWSLoaded", true,
122:                                false, null);
123:                    } catch (Exception e) {
124:                        Log.debugu("Unable to update session with JWS status "
125:                                + e.getMessage());
126:                        return;
127:                    }
128:
129:                    // Load resource
130:                    try {
131:                        Param.loadResourceBundle(true);
132:                    } catch (Exception ignore) {
133:                        Log
134:                                .info(Param
135:                                        .getString("pexcp.1",
136:                                                "Failed to get resource bundle for locale. Defaulting to en_US"));
137:                    }
138:
139:                    // Display UI
140:                    AbstractEventHandler abstractEventHandler = null;
141:
142:                    if (Param.getBrowserType().equals(BrowserType.IE))
143:                        abstractEventHandler = new RegistryEventHandler_JNLP();
144:                    //currently jnlp for netscape is supported only on windows..
145:                    else if ((Param.getBrowserType()
146:                            .equals(BrowserType.Netscape))) {
147:                        System.out
148:                                .println("Mozilla eventhandler going to be called ");
149:                        abstractEventHandler = new MozillaEventHandler_JNLP();
150:                    }
151:
152:                    (new JnlpMain()).launchUI(abstractEventHandler);
153:                } catch (Exception e) {
154:                    e.printStackTrace();
155:                }
156:            }
157:
158:            void launchUI(final AbstractEventHandler abstractEventHandler) {
159:                try {
160:                    javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
161:                        public void run() {
162:                            ProxyletUI.createAndShowGUI(abstractEventHandler);
163:                        }
164:                    });
165:                } catch (InterruptedException e) {
166:                    Log.debug(Param.getString("perr.9",
167:                            "ERR: Problem in displaying UI. Unknown error."));
168:                    return;
169:                } catch (InvocationTargetException e) {
170:                    Log.debug(Param.getString("perr.9",
171:                            "ERR: Problem in displaying UI. Unknown error."));
172:                    return;
173:                }
174:
175:                Param.setProxyletFilesForCleanup();
176:
177:                abstractEventHandler.handleStart(true);
178:
179:                //Start timer thread
180:                ValidateSession v = new ValidateSession(abstractEventHandler);
181:            }
182:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.