74 /** |
74 /** |
75 * Notifies Jsr plugins in iJsrPlugins vector that a MIDlet suite is |
75 * Notifies Jsr plugins in iJsrPlugins vector that a MIDlet suite is |
76 * about to be installed by calling the install() method of the plugins. |
76 * about to be installed by calling the install() method of the plugins. |
77 * |
77 * |
78 * @param aInfo notification information object |
78 * @param aInfo notification information object |
|
79 * @throws InstallerExtensionException if thrown from any of the Jsr plugins |
79 * @throws InstallerException if any of the Jsr plugins cancels installation |
80 * @throws InstallerException if any of the Jsr plugins cancels installation |
80 * @see InstallerExtension#install |
81 * @see InstallerExtension#install |
81 */ |
82 */ |
82 public void notifyInstallation(InstallerExtensionInfo aInfo) |
83 public void notifyInstallation(InstallerExtensionInfo aInfo) |
83 { |
84 { |
84 Log.log("JsrPluginNotifierBase.NotifyInstallation called"); |
85 Log.log("JsrPluginNotifierBase.NotifyInstallation called"); |
85 boolean continueInstallation = true; |
86 boolean continueInstallation = true; |
|
87 InstallerExtensionException installerExtensionException = null; |
86 InstallerExtension plugin = null; |
88 InstallerExtension plugin = null; |
87 for (int i = 0; i < iJsrPlugins.size(); i++) |
89 for (int i = 0; i < iJsrPlugins.size(); i++) |
88 { |
90 { |
89 try |
91 try |
90 { |
92 { |
91 plugin = (InstallerExtension)iJsrPlugins.elementAt(i); |
93 plugin = (InstallerExtension)iJsrPlugins.elementAt(i); |
92 Log.log("Jsr plugin install " + plugin.getClass().getName()); |
94 Log.log("Jsr plugin install " + plugin.getClass().getName()); |
93 continueInstallation = plugin.install(aInfo); |
95 continueInstallation = plugin.install(aInfo); |
94 } |
96 } |
|
97 catch (InstallerExtensionException iee) |
|
98 { |
|
99 installerExtensionException = iee; |
|
100 Log.logError("Installer Jsr plugin " + |
|
101 plugin.getClass().getName() + |
|
102 " install exception " + iee, iee); |
|
103 continueInstallation = false; |
|
104 } |
95 catch (Throwable t) |
105 catch (Throwable t) |
96 { |
106 { |
97 Log.logError("Installer Jsr plugin " + |
107 Log.logError("Installer Jsr plugin " + |
98 plugin.getClass().getName() + |
108 plugin.getClass().getName() + |
99 " install exception " + t, t); |
109 " install exception " + t, t); |
102 // Check if JSR plugin cancelled installation. |
112 // Check if JSR plugin cancelled installation. |
103 if (!continueInstallation) |
113 if (!continueInstallation) |
104 { |
114 { |
105 // Rollback those plugins which already got notified. |
115 // Rollback those plugins which already got notified. |
106 notifyRollbackInstall(aInfo, i); |
116 notifyRollbackInstall(aInfo, i); |
107 InstallerException.internalError( |
117 if (installerExtensionException != null) |
108 "Jsr plugin " + plugin.getClass().getName() + |
118 { |
109 " cancelled installation."); |
119 throw installerExtensionException; |
|
120 } |
|
121 else |
|
122 { |
|
123 InstallerException.internalError( |
|
124 "Jsr plugin " + plugin.getClass().getName() + |
|
125 " cancelled installation."); |
|
126 } |
110 } |
127 } |
111 } |
128 } |
112 } |
129 } |
113 |
130 |
114 /** |
131 /** |
115 * Notifies Jsr plugins in iJsrPlugins vector that a MIDlet suite is |
132 * Notifies Jsr plugins in iJsrPlugins vector that a MIDlet suite is |
116 * about to be uninstalled by calling the uninstall() method of the plugins. |
133 * about to be uninstalled by calling the uninstall() method of the plugins. |
117 * |
134 * |
118 * @param aInfo notification information object |
135 * @param aInfo notification information object |
|
136 * @throws InstallerExtensionException if thrown from any of the Jsr plugins |
119 * @throws InstallerException if any of the Jsr plugins cancels uninstallation |
137 * @throws InstallerException if any of the Jsr plugins cancels uninstallation |
120 * @see InstallerExtension#uninstall |
138 * @see InstallerExtension#uninstall |
121 */ |
139 */ |
122 public void notifyUninstallation(InstallerExtensionInfo aInfo) |
140 public void notifyUninstallation(InstallerExtensionInfo aInfo) |
123 { |
141 { |
124 Log.log("JsrPluginNotifierBase.notifyUninstallation called"); |
142 Log.log("JsrPluginNotifierBase.notifyUninstallation called"); |
125 boolean continueUninstallation = true; |
143 boolean continueUninstallation = true; |
|
144 InstallerExtensionException installerExtensionException = null; |
126 InstallerExtension plugin = null; |
145 InstallerExtension plugin = null; |
127 for (int i = 0; i < iJsrPlugins.size(); i++) |
146 for (int i = 0; i < iJsrPlugins.size(); i++) |
128 { |
147 { |
129 try |
148 try |
130 { |
149 { |
131 plugin = (InstallerExtension)iJsrPlugins.elementAt(i); |
150 plugin = (InstallerExtension)iJsrPlugins.elementAt(i); |
132 Log.log("Jsr plugin uninstall " + plugin.getClass().getName()); |
151 Log.log("Jsr plugin uninstall " + plugin.getClass().getName()); |
133 continueUninstallation = plugin.uninstall(aInfo); |
152 continueUninstallation = plugin.uninstall(aInfo); |
134 } |
153 } |
|
154 catch (InstallerExtensionException iee) |
|
155 { |
|
156 installerExtensionException = iee; |
|
157 Log.logError("Installer Jsr plugin " + |
|
158 plugin.getClass().getName() + |
|
159 " uninstall exception " + iee, iee); |
|
160 continueUninstallation = false; |
|
161 } |
135 catch (Throwable t) |
162 catch (Throwable t) |
136 { |
163 { |
137 Log.logError("Installer Jsr plugin " + |
164 Log.logError("Installer Jsr plugin " + |
138 plugin.getClass().getName() + |
165 plugin.getClass().getName() + |
139 " uninstall exception " + t, t); |
166 " uninstall exception " + t, t); |
142 // Check if JSR plugin cancelled uninstallation. |
169 // Check if JSR plugin cancelled uninstallation. |
143 if (!continueUninstallation) |
170 if (!continueUninstallation) |
144 { |
171 { |
145 // Rollback those plugins which already got notified. |
172 // Rollback those plugins which already got notified. |
146 notifyRollbackUninstall(aInfo, i); |
173 notifyRollbackUninstall(aInfo, i); |
147 InstallerException.internalError( |
174 if (installerExtensionException != null) |
148 "Jsr plugin " + plugin.getClass().getName() + |
175 { |
149 " cancelled uninstallation."); |
176 throw installerExtensionException; |
|
177 } |
|
178 else |
|
179 { |
|
180 InstallerException.internalError( |
|
181 "Jsr plugin " + plugin.getClass().getName() + |
|
182 " cancelled uninstallation."); |
|
183 } |
150 } |
184 } |
151 } |
185 } |
152 } |
186 } |
153 |
187 |
154 /** |
188 /** |