Changeset 6636
- Timestamp:
- Dec 3, 2014, 9:55:44 AM (8 years ago)
- Location:
- branches/3.3-stable
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-stable/src/core/net/sf/basedb/core/PluginDefinition.java
r6435 r6636 1265 1265 else 1266 1266 { 1267 if (unloadBefore) JarClassLoader.unload(jarPath); 1268 ClassLoader cl = JarClassLoader.getInstance(jarPath, Application.autoUnloadPlugins()); 1267 ClassLoader cl = JarClassLoader.getInstance(jarPath, unloadBefore || Application.autoUnloadPlugins()); 1269 1268 c = ClassUtil.checkAndLoadClass(cl, className, true, Plugin.class); 1270 1269 } -
branches/3.3-stable/src/core/net/sf/basedb/core/PluginType.java
r6127 r6636 325 325 else 326 326 { 327 JarClassLoader.unload(jarPath); 328 ClassLoader cl = JarClassLoader.getInstance(jarPath, Application.autoUnloadPlugins()); 327 ClassLoader cl = JarClassLoader.getInstance(jarPath, true); 329 328 c = cl.loadClass(interfaceName); 330 329 } -
branches/3.3-stable/src/core/net/sf/basedb/util/JarClassLoader.java
r6444 r6636 157 157 158 158 @param jarPath The path to the JAR file 159 */ 159 @deprecated In 3.3.4, use {@ #newInstance(String)} or {@link #getInstance(String, boolean)} with autoUnload=true instead 160 */ 161 @Deprecated 160 162 public static final void unload(String jarPath) 161 163 { -
branches/3.3-stable/src/test/TestJarClassLoader.java
r5610 r6636 49 49 test_load("JarPlugin.jar", "affymetrix.calvin.exception.CalvinException", false, true); 50 50 test_resource("JarPlugin.jar", "org/hibernate/hibernate-configuration-3.0.dtd", false, false); 51 test_unload("JarPlugin.jar");52 51 test_load("JarPlugin.jar", "affymetrix.calvin.exception.CalvinException", true, false); 53 52 test_resource("JarPlugin.jar", "org/hibernate/hibernate-configuration-3.0.dtd", true, false); … … 119 118 120 119 121 static void test_unload(String jarPath)122 {123 try124 {125 JarClassLoader.unload(jarPath);126 if (JarClassLoader.exists(jarPath))127 {128 throw new Exception("Class loader for '"+jarPath+"' was not unloaded.");129 }130 write("--Unload class loader OK");131 }132 catch (Throwable ex)133 {134 write("--Unload class loader FAILED");135 ex.printStackTrace();136 ok = false;137 }138 }139 140 120 static void write(String message) 141 121 { -
branches/3.3-stable/www/admin/pluginconfigurations/index.jsp
r6400 r6636 348 348 redirect = "../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&main_type=OTHER&title=Run+plugin"; 349 349 } 350 else if ("UnloadItems".equals(cmd))351 {352 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);353 dc = sc.newDbControl();354 for (int id : cc.getSelected())355 {356 PluginDefinition pd = PluginDefinition.getById(dc, id);357 if (pd.getJarPath() != null)358 {359 JarClassLoader.unload(pd.getJarPath());360 }361 }362 dc.close();363 redirect = listPage;364 }365 else if ("UnloadItem".equals(cmd))366 {367 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);368 dc = sc.newDbControl();369 PluginDefinition pd = PluginDefinition.getById(dc, cc.getId());370 if (pd.getJarPath() != null)371 {372 JarClassLoader.unload(pd.getJarPath());373 }374 dc.close();375 redirect = viewPage;376 }377 350 else 378 351 { -
branches/3.3-stable/www/admin/plugindefinitions/index.jsp
r6305 r6636 456 456 redirect = "../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&main_type=OTHER&title=Run+plugin"; 457 457 } 458 else if ("UnloadItems".equals(cmd))459 {460 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);461 dc = sc.newDbControl();462 for (int id : cc.getSelected())463 {464 PluginDefinition pd = PluginDefinition.getById(dc, id);465 if (pd.getJarPath() != null)466 {467 JarClassLoader.unload(pd.getJarPath());468 }469 }470 dc.close();471 redirect = listPage;472 }473 else if ("UnloadItem".equals(cmd))474 {475 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);476 dc = sc.newDbControl();477 PluginDefinition pd = PluginDefinition.getById(dc, cc.getId());478 if (pd.getJarPath() != null)479 {480 JarClassLoader.unload(pd.getJarPath());481 }482 dc.close();483 redirect = viewPage;484 }485 458 else 486 459 { -
branches/3.3-stable/www/admin/plugindefinitions/list_plugins.jsp
r6289 r6636 468 468 tooltip="Run a plugin" 469 469 visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" 470 />471 <tbl:button472 id="btnUnload"473 title="Unload"474 tooltip="Unload plugins"475 470 /> 476 471 <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" -
branches/3.3-stable/www/admin/plugindefinitions/plugins.js
r6592 r6636 116 116 Buttons.addClickHandler('btnRunPlugin', Buttons.runPlugin, attributes); 117 117 Buttons.addClickHandler('btnNewConfiguration', plugins.newConfiguration, attributes); 118 Buttons.addClickHandler('btnUnload', plugins.unloadPlugin, attributes);119 118 Buttons.addClickHandler('btnToggleDisabled', plugins.toggleDisabled); 120 119 … … 138 137 Buttons.addClickHandler('btnImport', Buttons.runListPlugin, tableAttributes); 139 138 Buttons.addClickHandler('btnRunPlugin', Buttons.runListPlugin, tableAttributes); 140 Buttons.addClickHandler('btnUnload', plugins.unloadSelected);141 139 142 140 Buttons.addClickHandler('close', App.closeWindow); … … 163 161 } 164 162 165 plugins.unloadSelected = function()166 {167 Table.submitSelected('plugins', 'UnloadItems');168 }169 170 plugins.unloadPlugin = function()171 {172 var pluginId = Data.get('page-data', 'item-id');173 var iframe = Data.get('page-data', 'iframe');174 175 var url = 'index.jsp?ID='+App.getSessionId();176 url += '&cmd=UnloadItem';177 url += '&item_id='+pluginId + '&iframe='+iframe;178 location.replace(url);179 }180 181 163 plugins.newConfiguration = function(event) 182 164 { -
branches/3.3-stable/www/admin/plugindefinitions/view_plugin.jsp
r6592 r6636 272 272 tooltip="Run a plugin" 273 273 visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" 274 />275 <tbl:button276 id="btnUnload"277 title="Unload"278 tooltip="<%=loaded && !internal ? "Unload the code for this plugin" : "The code for this plugin has not yet been loaded" %>"279 visible="<%=loaded && !internal%>"280 274 /> 281 275 <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
Note: See TracChangeset
for help on using the changeset viewer.