From: <do...@hy...> - 2008-02-20 05:33:07
|
Author: dougm Date: 2008-02-19 21:32:58 -0800 (Tue, 19 Feb 2008) New Revision: 7786 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=7786 Modified: trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossConfig.java trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossDetector.java trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossProductPlugin.java Log: [HHQ-1655] Allow full classpath to be configured during autodiscovery Modified: trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossConfig.java =================================================================== --- trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossConfig.java 2008-02-20 03:26:02 UTC (rev 7785) +++ trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossConfig.java 2008-02-20 05:32:58 UTC (rev 7786) @@ -181,8 +181,8 @@ return (val != null) && (val.length() != 0); } - private File getJBossHome(File configXML) { - File home = configXML.getParentFile(); + public File getJBossHome() { + File home = this.serviceXML.getParentFile(); while (home != null) { boolean isServer = home.getName().equals("server"); home = home.getParentFile(); @@ -287,7 +287,7 @@ else if ("StoreURL".equals(attrName)) { String url = getText(attr); - File home = getJBossHome(this.serviceXML); + File home = getJBossHome(); if (home != null) { log.debug("jboss.home.url=" + home); url = StringUtil.replace(url, Modified: trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossDetector.java =================================================================== --- trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossDetector.java 2008-02-20 03:26:02 UTC (rev 7785) +++ trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossDetector.java 2008-02-20 05:32:58 UTC (rev 7786) @@ -558,6 +558,13 @@ server.setName(server.getName() + " " + serverName); } + File home = cfg.getJBossHome(); + if (home != null) { + //normally setup in JBossProductPlugin + //this handles the case of the agent being started + //before the JBoss server + adjustClassPath(home.getPath()); + } //pickup any jars found relative to this installpath adjustClassPath(installpath); Modified: trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossProductPlugin.java =================================================================== --- trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossProductPlugin.java 2008-02-20 03:26:02 UTC (rev 7785) +++ trunk/plugins/jboss/src/org/hyperic/hq/plugin/jboss/JBossProductPlugin.java 2008-02-20 05:32:58 UTC (rev 7786) @@ -90,13 +90,18 @@ from = "properties"; } - if (installDir != null) { - getLog().debug("Setting " + PROP_INSTALLPATH + "=" + + String[] classpath = super.getClassPath(manager); + + if (installDir == null) { + getLog().debug(prop + " not configured"); + //may be resolved later by JBossDetector.adjustClassPath + return classpath; + } + else { + getLog().debug("Setting " + prop + "=" + installDir + ", configured from " + from); } - String[] classpath = super.getClassPath(manager); - for (int i=0; i<classpath.length; i++) { classpath[i] = installDir + "/" + classpath[i]; } |