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


001:        package com.sun.portal.proxylet.client.applet;
002:
003:        import com.sun.portal.proxylet.client.common.Param;
004:        import com.sun.portal.proxylet.client.common.ValidateSession;
005:        import com.sun.portal.proxylet.client.common.Log;
006:        import com.sun.portal.proxylet.client.common.ui.ProxyletUI;
007:        import com.sun.portal.proxylet.client.common.ui.AbstractEventHandler;
008:        import com.sun.portal.proxylet.client.common.browser.BrowserType;
009:        import com.sun.portal.proxylet.client.common.browser.RegistryEventHandler;
010:        import com.sun.portal.proxylet.client.common.browser.MozillaEventHandler;
011:
012:        import java.awt.Graphics;
013:        import java.lang.reflect.InvocationTargetException;
014:
015:        import javax.swing.JApplet;
016:
017:        public class ProxyletApplet extends JApplet {
018:
019:            AbstractEventHandler ahandler;
020:
021:            public void init() {
022:
023:                Param.cleanupPreviousSessionsProxyletFiles();
024:
025:                // Set the log level first
026:                String temp = this .getParameter("DEBUGLEVEL");
027:                Log
028:                        .setloglevel_JavaConsole((temp != null && temp
029:                                .equals("1")) ? true : false);
030:
031:                // Intialize Param from applet parameters
032:                Param.readParameters(this );
033:
034:                // Check if Proxylet is already running.. if so quit this session
035:                if (Param.isProxyletRunning()) {
036:                    try {
037:                        Param.sendMsgtoServlet("?command=setAppletLoaded",
038:                                false, false, null);
039:                    } catch (Exception e) {
040:                        Log
041:                                .debugu("Unable to update session with status of applet"
042:                                        + e.getMessage());
043:                    }
044:                    Log
045:                            .info(Param
046:                                    .getString("pinfo.7",
047:                                            "Detected another instance of proxylet on this machine \\n Quitting"));
048:
049:                    try {
050:                        // Wait for few seconds for user to read the message
051:                        Thread.sleep(5 * 1000);
052:                    } catch (Exception e) {
053:                    }
054:                    System.exit(1);
055:                }
056:
057:                // if proxylet rules is not defined , load pac content
058:                if (Param.getRules() != null
059:                        && Param.getRules().equals("$RULES")) {
060:                    Param.loadPacContent();
061:                }
062:
063:                System.out.println(" b4 setAppletLoaded ");
064:                // update the servlet with status of applet
065:                try {
066:                    Param.sendMsgtoServlet("?command=setAppletLoaded", true,
067:                            false, null);
068:                } catch (Exception e) {
069:                    Log.debugu("Unable to update session with applet status "
070:                            + e.getMessage());
071:                    return;
072:                }
073:
074:                System.out.println(" b4 loadResourcebundle ");
075:
076:                // Load resource bundle
077:                try {
078:                    Param.loadResourceBundle(true);
079:                } catch (Exception ignore) {
080:                    Log
081:                            .info(Param
082:                                    .getString("pexcp.1",
083:                                            "Failed to get resource bundle for locale. Defaulting to en_US"));
084:                }
085:
086:                // Display UI
087:                ahandler = null;
088:                if (Param.getBrowserType().equals(BrowserType.IE))
089:                    ahandler = new RegistryEventHandler();
090:                else if (Param.getBrowserType().equals(BrowserType.Netscape)) {
091:                    System.out.println("MozillaEventHandler invoked");
092:                    ahandler = new MozillaEventHandler();
093:                } else {
094:                    Log.debugu(Param.getString("pinfo.11",
095:                            "Unsupported Browser Version"));
096:                    return;
097:                }
098:
099:                final AbstractEventHandler mainobj = ahandler;
100:                final ProxyletApplet parent = this ;
101:                try {
102:                    javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
103:                        public void run() {
104:                            ProxyletUI.createAndShowGUIInJApplet(parent,
105:                                    mainobj);
106:                        }
107:                    });
108:                } catch (InterruptedException e) {
109:                    Log.debug(Param.getString("perr.9",
110:                            "ERR: Problem in displaying UI. Unknown error."));
111:                    return;
112:                } catch (InvocationTargetException e) {
113:                    Log.debug(Param.getString("perr.9",
114:                            "ERR: Problem in displaying UI. Unknown error."));
115:                    return;
116:                }
117:
118:                mainobj.handleStart(true);
119:
120:                //Start timer thread
121:                ValidateSession v = new ValidateSession(mainobj);
122:
123:                // Added for netlet proxylet seperation
124:                System.setProperty("com.sun.portal.proxylet.proxyletMode",
125:                        "true");
126:                if (Param.getClientProxyHost() != null) {
127:                    System.setProperty("com.sun.portal.proxylet.proxyHost",
128:                            Param.getClientProxyHost());
129:                    System.setProperty("com.sun.portal.proxylet.proxyPort",
130:                            Integer.toString(Param.getClientProxyPort()));
131:                }
132:
133:                Param.setProxyletFilesForCleanup();
134:            }
135:
136:            public void start() {
137:
138:            }
139:
140:            public void stop() {
141:                try {
142:                    super .stop();
143:                    //
144:                    // The window handle was getting invalidated by this time.
145:                    // So, the script onclose function will take care of this
146:                    //
147:                    //browser.restoreDefaultPref(this, pref);
148:                } catch (Exception e) {
149:                    e.printStackTrace();
150:                }
151:            }
152:
153:            public void addItem(String newWord) {
154:                repaint();
155:            }
156:
157:            public void paint(Graphics g) {
158:                super .paint(g);
159:            }
160:
161:            public void sweetCleanUp() {
162:                System.out.println("In sweetcleanup");
163:                ahandler.handleStop();
164:                stop();
165:                destroy();
166:            }
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.