Source Code Cross Referenced for CHAutoTester.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » installer » 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 » j2me » com.sun.midp.installer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  
003:         *
004:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation.
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt).
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions.
025:         */
026:
027:        package com.sun.midp.installer;
028:
029:        import java.io.*;
030:
031:        import javax.microedition.rms.*;
032:
033:        import com.sun.midp.i18n.Resource;
034:
035:        import com.sun.midp.i18n.ResourceConstants;
036:
037:        import com.sun.midp.main.MIDletSuiteLoader;
038:
039:        import com.sun.midp.midlet.MIDletStateHandler;
040:
041:        import com.sun.midp.midletsuite.MIDletInfo;
042:        import com.sun.midp.midletsuite.MIDletSuiteStorage;
043:
044:        import com.sun.midp.log.Logging;
045:        import com.sun.midp.log.LogChannels;
046:
047:        /**
048:         * Installs/Updates a test suite for CHAPI, runs the first MIDlet 
049:         * in the suite in a loop 
050:         * specified number of iterations or until the new version of the suite is not 
051:         * found, then removes the suite. 
052:         * <p> The modifications for CHAPI enable the security checks during
053:         * the installation by enabling the listener.
054:         * The security prompts are handled by the installer.
055:         * The listener responds without prompting to requests to install the jar and
056:         * and to delete the RMS storage of the application (if ask). 
057:         * <p>
058:         * The MIDlet uses these application properties as arguments: </p>
059:         * <ol>
060:         *   <li>arg-0: URL for the test suite
061:         *   <li>arg-1: Used to override the default domain used when installing
062:         *    an unsigned suite. The default is maximum to allow the runtime API tests
063:         *    be performed automatically without tester interaction.
064:         *    <li>arg-2: Integer number, specifying how many iterations to run
065:         *    the suite. If argument is not given or less then zero, then suite
066:         *    will be run until the new version of the suite is not found.
067:         * </ol>
068:         * <p>
069:         * If arg-0 is not given then a form will be used to query the tester for
070:         * the arguments.</p>
071:         */
072:        public class CHAutoTester extends AutoTester implements  InstallListener {
073:
074:            /**
075:             * Installs and performs the tests.
076:             *
077:             * @param midletSuiteStorage MIDletSuiteStorage object
078:             * @param inp_installer Installer object
079:             * @param inp_url URL of the test suite
080:             */
081:            public void installAndPerformTests(
082:                    MIDletSuiteStorage midletSuiteStorage,
083:                    Installer inp_installer, String inp_url) {
084:
085:                installListener = this ;
086:                super .installAndPerformTests(midletSuiteStorage, inp_installer,
087:                        url);
088:            }
089:
090:            /**
091:             * Called with the current state of the install so the user can be
092:             * asked to override the warning. To get the warning from the state
093:             * call {@link InstallState#getLastException()}. If false is returned,
094:             * the last exception in the state will be thrown and
095:             * {@link Installer#wasStopped()} will return true if called.
096:             *
097:             * @param state current state of the install.
098:             *
099:             * @return true this installer does not stop.
100:             */
101:            public boolean warnUser(InstallState state) {
102:                return true;
103:            }
104:
105:            /**
106:             * Called with the current state of the install so the user can be
107:             * asked to confirm the jar download.
108:             * If false is returned, the an I/O exception thrown and
109:             * {@link Installer#wasStopped()} will return true if called.
110:             *
111:             * @param state current state of the install.
112:             *
113:             * @return true; this installer always continues
114:             */
115:            public boolean confirmJarDownload(InstallState state) {
116:                return true;
117:            }
118:
119:            /**
120:             * Called with the current status of the install. See
121:             * {@link Installer} for the status codes.
122:             *
123:             * @param status current status of the install.
124:             * @param state current state of the install.
125:             */
126:            public void updateStatus(int status, InstallState state) {
127:                // Ignore
128:            }
129:
130:            /**
131:             * Called with the current state of the install so the user can be
132:             * asked to confirm if the RMS data should be kept for new version of
133:             * an updated suite.
134:             *
135:             * @param state current state of the install.
136:             *
137:             * @return false; never keep the RMS data if asked.
138:             */
139:            public boolean keepRMS(InstallState state) {
140:                return false;
141:            }
142:
143:            /**
144:             * Called with the current state of the install so the user can be
145:             * asked to confirm the authentication path.
146:             * If false is returned, the an I/O exception thrown and
147:             * {@link Installer#wasStopped()} will return true if called.
148:             *
149:             * @param state current state of the install.
150:             *
151:             * @return true to continue the install
152:             */
153:            public boolean confirmAuthPath(InstallState state) {
154:                return true;
155:            }
156:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.