From: <tk...@hy...> - 2008-03-31 07:27:17
|
Author: tkeeney Date: 2008-03-31 00:27:15 -0700 (Mon, 31 Mar 2008) New Revision: 8596 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=8596 Modified: trunk/src/org/hyperic/hq/product/server/mbean/ProductPluginDeployer.java Log: When undeploying the HQ app from within the in-container unit test framework, need to be able to stop the ProductPluginDeployer from the ServerLifecycle. Make stop() a managed operation so it can be invoked through JMX. setReady() can throw a NPE when the ProductPluginDeployer is deployed within the in-container unit test framework. Modified: trunk/src/org/hyperic/hq/product/server/mbean/ProductPluginDeployer.java =================================================================== --- trunk/src/org/hyperic/hq/product/server/mbean/ProductPluginDeployer.java 2008-03-31 07:24:09 UTC (rev 8595) +++ trunk/src/org/hyperic/hq/product/server/mbean/ProductPluginDeployer.java 2008-03-31 07:27:15 UTC (rev 8596) @@ -528,14 +528,16 @@ } private void setReady(boolean ready) { - try { - getServer().setAttribute(_readyMgrName, - new Attribute(READY_ATTR, - ready ? Boolean.TRUE : - Boolean.FALSE)); - } catch(Exception e) { - _log.error("Unable to declare application ready", e); - } + if (getServer() != null) { + try { + getServer().setAttribute(_readyMgrName, + new Attribute(READY_ATTR, + ready ? Boolean.TRUE : + Boolean.FALSE)); + } catch(Exception e) { + _log.error("Unable to declare application ready", e); + } + } } /** @@ -738,6 +740,9 @@ addCustomPluginDir(); } + /** + * @jmx:managed-operation + */ public void stop() { super.stop(); pluginNotify("deployer", DEPLOYER_SUSPENDED); |