/javadoc/com/googlecode/jmxtrans/util/JmxUtils.html

http://jmxtrans.googlecode.com/ · HTML · 703 lines · 602 code · 78 blank · 23 comment · 0 complexity · d80b350584c376b27c2eccaa7abde980 MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.6.0_24) on Fri Jul 08 14:42:36 PDT 2011 -->
  6. <TITLE>
  7. JmxUtils (jmxlogger javadoc)
  8. </TITLE>
  9. <META NAME="date" CONTENT="2011-07-08">
  10. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
  11. <SCRIPT type="text/javascript">
  12. function windowTitle()
  13. {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="JmxUtils (jmxlogger javadoc)";
  16. }
  17. }
  18. </SCRIPT>
  19. <NOSCRIPT>
  20. </NOSCRIPT>
  21. </HEAD>
  22. <BODY BGCOLOR="white" onload="windowTitle();">
  23. <HR>
  24. <!-- ========= START OF TOP NAVBAR ======= -->
  25. <A NAME="navbar_top"><!-- --></A>
  26. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  27. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  28. <TR>
  29. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  30. <A NAME="navbar_top_firstrow"><!-- --></A>
  31. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  32. <TR ALIGN="center" VALIGN="top">
  33. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  34. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  35. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  36. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  37. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  38. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  39. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  40. </TR>
  41. </TABLE>
  42. </TD>
  43. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  44. </EM>
  45. </TD>
  46. </TR>
  47. <TR>
  48. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  49. &nbsp;<A HREF="../../../../com/googlecode/jmxtrans/util/JmxConnectionFactory.html" title="class in com.googlecode.jmxtrans.util"><B>PREV CLASS</B></A>&nbsp;
  50. &nbsp;<A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.ProcessQueryThread.html" title="class in com.googlecode.jmxtrans.util"><B>NEXT CLASS</B></A></FONT></TD>
  51. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  52. <A HREF="../../../../index.html?com/googlecode/jmxtrans/util/JmxUtils.html" target="_top"><B>FRAMES</B></A> &nbsp;
  53. &nbsp;<A HREF="JmxUtils.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  54. &nbsp;<SCRIPT type="text/javascript">
  55. <!--
  56. if(window==top) {
  57. document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  58. }
  59. //-->
  60. </SCRIPT>
  61. <NOSCRIPT>
  62. <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
  63. </NOSCRIPT>
  64. </FONT></TD>
  65. </TR>
  66. <TR>
  67. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  68. SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  69. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  70. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  71. </TR>
  72. </TABLE>
  73. <A NAME="skip-navbar_top"></A>
  74. <!-- ========= END OF TOP NAVBAR ========= -->
  75. <HR>
  76. <!-- ======== START OF CLASS DATA ======== -->
  77. <H2>
  78. <FONT SIZE="-1">
  79. com.googlecode.jmxtrans.util</FONT>
  80. <BR>
  81. Class JmxUtils</H2>
  82. <PRE>
  83. java.lang.Object
  84. <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.googlecode.jmxtrans.util.JmxUtils</B>
  85. </PRE>
  86. <HR>
  87. <DL>
  88. <DT><PRE>public class <B>JmxUtils</B><DT>extends java.lang.Object</DL>
  89. </PRE>
  90. <P>
  91. The worker code.
  92. <P>
  93. <P>
  94. <DL>
  95. <DT><B>Author:</B></DT>
  96. <DD>jon</DD>
  97. </DL>
  98. <HR>
  99. <P>
  100. <!-- ======== NESTED CLASS SUMMARY ======== -->
  101. <A NAME="nested_class_summary"><!-- --></A>
  102. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  103. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  104. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  105. <B>Nested Class Summary</B></FONT></TH>
  106. </TR>
  107. <TR BGCOLOR="white" CLASS="TableRowColor">
  108. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  109. <CODE>static&nbsp;class</CODE></FONT></TD>
  110. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.ProcessQueryThread.html" title="class in com.googlecode.jmxtrans.util">JmxUtils.ProcessQueryThread</A></B></CODE>
  111. <BR>
  112. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Executes either a getAttribute or getAttributes query.</TD>
  113. </TR>
  114. <TR BGCOLOR="white" CLASS="TableRowColor">
  115. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  116. <CODE>static&nbsp;class</CODE></FONT></TD>
  117. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.ProcessServerThread.html" title="class in com.googlecode.jmxtrans.util">JmxUtils.ProcessServerThread</A></B></CODE>
  118. <BR>
  119. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Executes either a getAttribute or getAttributes query.</TD>
  120. </TR>
  121. </TABLE>
  122. &nbsp;
  123. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  124. <A NAME="constructor_summary"><!-- --></A>
  125. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  126. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  127. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  128. <B>Constructor Summary</B></FONT></TH>
  129. </TR>
  130. <TR BGCOLOR="white" CLASS="TableRowColor">
  131. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#JmxUtils()">JmxUtils</A></B>()</CODE>
  132. <BR>
  133. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  134. </TR>
  135. </TABLE>
  136. &nbsp;
  137. <!-- ========== METHOD SUMMARY =========== -->
  138. <A NAME="method_summary"><!-- --></A>
  139. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  140. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  141. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  142. <B>Method Summary</B></FONT></TH>
  143. </TR>
  144. <TR BGCOLOR="white" CLASS="TableRowColor">
  145. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  146. <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
  147. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#cleanupStr(java.lang.String)">cleanupStr</A></B>(java.lang.String&nbsp;name)</CODE>
  148. <BR>
  149. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Replaces all .</TD>
  150. </TR>
  151. <TR BGCOLOR="white" CLASS="TableRowColor">
  152. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  153. <CODE>static&nbsp;void</CODE></FONT></TD>
  154. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#execute(com.googlecode.jmxtrans.model.JmxProcess)">execute</A></B>(<A HREF="../../../../com/googlecode/jmxtrans/model/JmxProcess.html" title="class in com.googlecode.jmxtrans.model">JmxProcess</A>&nbsp;process)</CODE>
  155. <BR>
  156. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Either invokes the servers multithreaded (max threads == jmxProcess.getMultiThreaded())
  157. or invokes them one at a time.</TD>
  158. </TR>
  159. <TR BGCOLOR="white" CLASS="TableRowColor">
  160. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  161. <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
  162. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#getConcatedTypeNameValues(java.util.List, java.lang.String)">getConcatedTypeNameValues</A></B>(java.util.List&lt;java.lang.String&gt;&nbsp;typeNames,
  163. java.lang.String&nbsp;typeNameStr)</CODE>
  164. <BR>
  165. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Given a typeName string, get the first match from the typeNames setting.</TD>
  166. </TR>
  167. <TR BGCOLOR="white" CLASS="TableRowColor">
  168. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  169. <CODE>static&nbsp;java.util.Map&lt;java.lang.String,org.apache.commons.pool.KeyedObjectPool&gt;</CODE></FONT></TD>
  170. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#getDefaultPoolMap()">getDefaultPoolMap</A></B>()</CODE>
  171. <BR>
  172. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Helper method which returns a default PoolMap.</TD>
  173. </TR>
  174. <TR BGCOLOR="white" CLASS="TableRowColor">
  175. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  176. <CODE>static&nbsp;java.util.Map&lt;java.lang.String,java.lang.String[]&gt;</CODE></FONT></TD>
  177. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#getEnvironment(com.googlecode.jmxtrans.model.Server)">getEnvironment</A></B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&nbsp;server)</CODE>
  178. <BR>
  179. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates the proper username/password environment for JMX connections.</TD>
  180. </TR>
  181. <TR BGCOLOR="white" CLASS="TableRowColor">
  182. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  183. <CODE>static&nbsp;<A HREF="../../../../com/googlecode/jmxtrans/model/JmxProcess.html" title="class in com.googlecode.jmxtrans.model">JmxProcess</A></CODE></FONT></TD>
  184. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#getJmxProcess(java.io.File)">getJmxProcess</A></B>(java.io.File&nbsp;file)</CODE>
  185. <BR>
  186. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Uses jackson to load json configuration from a File into a full object
  187. tree representation of that json.</TD>
  188. </TR>
  189. <TR BGCOLOR="white" CLASS="TableRowColor">
  190. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  191. <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
  192. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#getKeyString(com.googlecode.jmxtrans.model.Query, com.googlecode.jmxtrans.model.Result, java.util.Map.Entry, java.util.List, java.lang.String)">getKeyString</A></B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Query.html" title="class in com.googlecode.jmxtrans.model">Query</A>&nbsp;query,
  193. <A HREF="../../../../com/googlecode/jmxtrans/model/Result.html" title="class in com.googlecode.jmxtrans.model">Result</A>&nbsp;result,
  194. java.util.Map.Entry&lt;java.lang.String,java.lang.Object&gt;&nbsp;values,
  195. java.util.List&lt;java.lang.String&gt;&nbsp;typeNames,
  196. java.lang.String&nbsp;rootPrefix)</CODE>
  197. <BR>
  198. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  199. </TR>
  200. <TR BGCOLOR="white" CLASS="TableRowColor">
  201. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  202. <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
  203. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#getKeyString2(com.googlecode.jmxtrans.model.Query, com.googlecode.jmxtrans.model.Result, java.util.Map.Entry, java.util.List, java.lang.String)">getKeyString2</A></B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Query.html" title="class in com.googlecode.jmxtrans.model">Query</A>&nbsp;query,
  204. <A HREF="../../../../com/googlecode/jmxtrans/model/Result.html" title="class in com.googlecode.jmxtrans.model">Result</A>&nbsp;result,
  205. java.util.Map.Entry&lt;java.lang.String,java.lang.Object&gt;&nbsp;values,
  206. java.util.List&lt;java.lang.String&gt;&nbsp;typeNames,
  207. java.lang.String&nbsp;rootPrefix)</CODE>
  208. <BR>
  209. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  210. </TR>
  211. <TR BGCOLOR="white" CLASS="TableRowColor">
  212. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  213. <CODE>static&nbsp;javax.management.remote.JMXConnector</CODE></FONT></TD>
  214. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#getServerConnection(com.googlecode.jmxtrans.model.Server)">getServerConnection</A></B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&nbsp;server)</CODE>
  215. <BR>
  216. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Helper method for connecting to a Server.</TD>
  217. </TR>
  218. <TR BGCOLOR="white" CLASS="TableRowColor">
  219. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  220. <CODE>static&nbsp;boolean</CODE></FONT></TD>
  221. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#isNumeric(java.lang.Object)">isNumeric</A></B>(java.lang.Object&nbsp;value)</CODE>
  222. <BR>
  223. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Useful for figuring out if an Object is a number.</TD>
  224. </TR>
  225. <TR BGCOLOR="white" CLASS="TableRowColor">
  226. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  227. <CODE>static&nbsp;boolean</CODE></FONT></TD>
  228. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#isNumeric(java.lang.String)">isNumeric</A></B>(java.lang.String&nbsp;str)</CODE>
  229. <BR>
  230. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the String contains only unicode digits.</TD>
  231. </TR>
  232. <TR BGCOLOR="white" CLASS="TableRowColor">
  233. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  234. <CODE>static&nbsp;void</CODE></FONT></TD>
  235. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#mergeServerLists(java.util.List, java.util.List)">mergeServerLists</A></B>(java.util.List&lt;<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&gt;&nbsp;existing,
  236. java.util.List&lt;<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&gt;&nbsp;adding)</CODE>
  237. <BR>
  238. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Merges two lists of servers (and their queries).</TD>
  239. </TR>
  240. <TR BGCOLOR="white" CLASS="TableRowColor">
  241. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  242. <CODE>static&nbsp;void</CODE></FONT></TD>
  243. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#prettyPrintJson(com.googlecode.jmxtrans.model.JmxProcess)">prettyPrintJson</A></B>(<A HREF="../../../../com/googlecode/jmxtrans/model/JmxProcess.html" title="class in com.googlecode.jmxtrans.model">JmxProcess</A>&nbsp;process)</CODE>
  244. <BR>
  245. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Utility function good for testing things.</TD>
  246. </TR>
  247. <TR BGCOLOR="white" CLASS="TableRowColor">
  248. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  249. <CODE>static&nbsp;void</CODE></FONT></TD>
  250. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#printJson(com.googlecode.jmxtrans.model.JmxProcess)">printJson</A></B>(<A HREF="../../../../com/googlecode/jmxtrans/model/JmxProcess.html" title="class in com.googlecode.jmxtrans.model">JmxProcess</A>&nbsp;process)</CODE>
  251. <BR>
  252. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Utility function good for testing things.</TD>
  253. </TR>
  254. <TR BGCOLOR="white" CLASS="TableRowColor">
  255. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  256. <CODE>static&nbsp;void</CODE></FONT></TD>
  257. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#processQueriesForServer(javax.management.MBeanServerConnection, com.googlecode.jmxtrans.model.Server)">processQueriesForServer</A></B>(javax.management.MBeanServerConnection&nbsp;mbeanServer,
  258. <A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&nbsp;server)</CODE>
  259. <BR>
  260. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Either invokes the queries multithreaded (max threads == server.getMultiThreaded())
  261. or invokes them one at a time.</TD>
  262. </TR>
  263. <TR BGCOLOR="white" CLASS="TableRowColor">
  264. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  265. <CODE>static&nbsp;void</CODE></FONT></TD>
  266. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#processQuery(javax.management.MBeanServerConnection, com.googlecode.jmxtrans.model.Query)">processQuery</A></B>(javax.management.MBeanServerConnection&nbsp;mbeanServer,
  267. <A HREF="../../../../com/googlecode/jmxtrans/model/Query.html" title="class in com.googlecode.jmxtrans.model">Query</A>&nbsp;query)</CODE>
  268. <BR>
  269. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Responsible for processing individual Queries.</TD>
  270. </TR>
  271. <TR BGCOLOR="white" CLASS="TableRowColor">
  272. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  273. <CODE>static&nbsp;void</CODE></FONT></TD>
  274. <TD><CODE><B><A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.html#processServer(com.googlecode.jmxtrans.model.Server, javax.management.remote.JMXConnector)">processServer</A></B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&nbsp;server,
  275. javax.management.remote.JMXConnector&nbsp;conn)</CODE>
  276. <BR>
  277. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does the work for processing a Server object.</TD>
  278. </TR>
  279. </TABLE>
  280. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  281. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  282. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  283. <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
  284. </TR>
  285. <TR BGCOLOR="white" CLASS="TableRowColor">
  286. <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
  287. </TR>
  288. </TABLE>
  289. &nbsp;
  290. <P>
  291. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  292. <A NAME="constructor_detail"><!-- --></A>
  293. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  294. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  295. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  296. <B>Constructor Detail</B></FONT></TH>
  297. </TR>
  298. </TABLE>
  299. <A NAME="JmxUtils()"><!-- --></A><H3>
  300. JmxUtils</H3>
  301. <PRE>
  302. public <B>JmxUtils</B>()</PRE>
  303. <DL>
  304. </DL>
  305. <!-- ============ METHOD DETAIL ========== -->
  306. <A NAME="method_detail"><!-- --></A>
  307. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  308. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  309. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  310. <B>Method Detail</B></FONT></TH>
  311. </TR>
  312. </TABLE>
  313. <A NAME="mergeServerLists(java.util.List, java.util.List)"><!-- --></A><H3>
  314. mergeServerLists</H3>
  315. <PRE>
  316. public static void <B>mergeServerLists</B>(java.util.List&lt;<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&gt;&nbsp;existing,
  317. java.util.List&lt;<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&gt;&nbsp;adding)</PRE>
  318. <DL>
  319. <DD>Merges two lists of servers (and their queries). Based on the equality of both sets of objects.
  320. Public for testing purposes.
  321. <P>
  322. <DD><DL>
  323. </DL>
  324. </DD>
  325. </DL>
  326. <HR>
  327. <A NAME="processQueriesForServer(javax.management.MBeanServerConnection, com.googlecode.jmxtrans.model.Server)"><!-- --></A><H3>
  328. processQueriesForServer</H3>
  329. <PRE>
  330. public static void <B>processQueriesForServer</B>(javax.management.MBeanServerConnection&nbsp;mbeanServer,
  331. <A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&nbsp;server)
  332. throws java.lang.Exception</PRE>
  333. <DL>
  334. <DD>Either invokes the queries multithreaded (max threads == server.getMultiThreaded())
  335. or invokes them one at a time.
  336. <P>
  337. <DD><DL>
  338. <DT><B>Throws:</B>
  339. <DD><CODE>java.lang.Exception</CODE></DL>
  340. </DD>
  341. </DL>
  342. <HR>
  343. <A NAME="processQuery(javax.management.MBeanServerConnection, com.googlecode.jmxtrans.model.Query)"><!-- --></A><H3>
  344. processQuery</H3>
  345. <PRE>
  346. public static void <B>processQuery</B>(javax.management.MBeanServerConnection&nbsp;mbeanServer,
  347. <A HREF="../../../../com/googlecode/jmxtrans/model/Query.html" title="class in com.googlecode.jmxtrans.model">Query</A>&nbsp;query)
  348. throws java.lang.Exception</PRE>
  349. <DL>
  350. <DD>Responsible for processing individual Queries.
  351. <P>
  352. <DD><DL>
  353. <DT><B>Throws:</B>
  354. <DD><CODE>java.lang.Exception</CODE></DL>
  355. </DD>
  356. </DL>
  357. <HR>
  358. <A NAME="getEnvironment(com.googlecode.jmxtrans.model.Server)"><!-- --></A><H3>
  359. getEnvironment</H3>
  360. <PRE>
  361. public static java.util.Map&lt;java.lang.String,java.lang.String[]&gt; <B>getEnvironment</B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&nbsp;server)</PRE>
  362. <DL>
  363. <DD>Generates the proper username/password environment for JMX connections.
  364. <P>
  365. <DD><DL>
  366. </DL>
  367. </DD>
  368. </DL>
  369. <HR>
  370. <A NAME="execute(com.googlecode.jmxtrans.model.JmxProcess)"><!-- --></A><H3>
  371. execute</H3>
  372. <PRE>
  373. public static void <B>execute</B>(<A HREF="../../../../com/googlecode/jmxtrans/model/JmxProcess.html" title="class in com.googlecode.jmxtrans.model">JmxProcess</A>&nbsp;process)
  374. throws java.lang.Exception</PRE>
  375. <DL>
  376. <DD>Either invokes the servers multithreaded (max threads == jmxProcess.getMultiThreaded())
  377. or invokes them one at a time.
  378. <P>
  379. <DD><DL>
  380. <DT><B>Throws:</B>
  381. <DD><CODE>java.lang.Exception</CODE></DL>
  382. </DD>
  383. </DL>
  384. <HR>
  385. <A NAME="getServerConnection(com.googlecode.jmxtrans.model.Server)"><!-- --></A><H3>
  386. getServerConnection</H3>
  387. <PRE>
  388. public static javax.management.remote.JMXConnector <B>getServerConnection</B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&nbsp;server)
  389. throws java.lang.Exception</PRE>
  390. <DL>
  391. <DD>Helper method for connecting to a Server. You need to close the resulting connection.
  392. <P>
  393. <DD><DL>
  394. <DT><B>Throws:</B>
  395. <DD><CODE>java.lang.Exception</CODE></DL>
  396. </DD>
  397. </DL>
  398. <HR>
  399. <A NAME="processServer(com.googlecode.jmxtrans.model.Server, javax.management.remote.JMXConnector)"><!-- --></A><H3>
  400. processServer</H3>
  401. <PRE>
  402. public static void <B>processServer</B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Server.html" title="class in com.googlecode.jmxtrans.model">Server</A>&nbsp;server,
  403. javax.management.remote.JMXConnector&nbsp;conn)
  404. throws java.lang.Exception</PRE>
  405. <DL>
  406. <DD>Does the work for processing a Server object.
  407. <P>
  408. <DD><DL>
  409. <DT><B>Throws:</B>
  410. <DD><CODE>java.lang.Exception</CODE></DL>
  411. </DD>
  412. </DL>
  413. <HR>
  414. <A NAME="printJson(com.googlecode.jmxtrans.model.JmxProcess)"><!-- --></A><H3>
  415. printJson</H3>
  416. <PRE>
  417. public static void <B>printJson</B>(<A HREF="../../../../com/googlecode/jmxtrans/model/JmxProcess.html" title="class in com.googlecode.jmxtrans.model">JmxProcess</A>&nbsp;process)
  418. throws java.lang.Exception</PRE>
  419. <DL>
  420. <DD>Utility function good for testing things. Prints out the json
  421. tree of the JmxProcess.
  422. <P>
  423. <DD><DL>
  424. <DT><B>Throws:</B>
  425. <DD><CODE>java.lang.Exception</CODE></DL>
  426. </DD>
  427. </DL>
  428. <HR>
  429. <A NAME="prettyPrintJson(com.googlecode.jmxtrans.model.JmxProcess)"><!-- --></A><H3>
  430. prettyPrintJson</H3>
  431. <PRE>
  432. public static void <B>prettyPrintJson</B>(<A HREF="../../../../com/googlecode/jmxtrans/model/JmxProcess.html" title="class in com.googlecode.jmxtrans.model">JmxProcess</A>&nbsp;process)
  433. throws java.lang.Exception</PRE>
  434. <DL>
  435. <DD>Utility function good for testing things. Prints out the json
  436. tree of the JmxProcess.
  437. <P>
  438. <DD><DL>
  439. <DT><B>Throws:</B>
  440. <DD><CODE>java.lang.Exception</CODE></DL>
  441. </DD>
  442. </DL>
  443. <HR>
  444. <A NAME="getJmxProcess(java.io.File)"><!-- --></A><H3>
  445. getJmxProcess</H3>
  446. <PRE>
  447. public static <A HREF="../../../../com/googlecode/jmxtrans/model/JmxProcess.html" title="class in com.googlecode.jmxtrans.model">JmxProcess</A> <B>getJmxProcess</B>(java.io.File&nbsp;file)
  448. throws org.codehaus.jackson.JsonParseException,
  449. org.codehaus.jackson.map.JsonMappingException,
  450. java.io.IOException</PRE>
  451. <DL>
  452. <DD>Uses jackson to load json configuration from a File into a full object
  453. tree representation of that json.
  454. <P>
  455. <DD><DL>
  456. <DT><B>Throws:</B>
  457. <DD><CODE>org.codehaus.jackson.JsonParseException</CODE>
  458. <DD><CODE>org.codehaus.jackson.map.JsonMappingException</CODE>
  459. <DD><CODE>java.io.IOException</CODE></DL>
  460. </DD>
  461. </DL>
  462. <HR>
  463. <A NAME="isNumeric(java.lang.Object)"><!-- --></A><H3>
  464. isNumeric</H3>
  465. <PRE>
  466. public static boolean <B>isNumeric</B>(java.lang.Object&nbsp;value)</PRE>
  467. <DL>
  468. <DD>Useful for figuring out if an Object is a number.
  469. <P>
  470. <DD><DL>
  471. </DL>
  472. </DD>
  473. </DL>
  474. <HR>
  475. <A NAME="isNumeric(java.lang.String)"><!-- --></A><H3>
  476. isNumeric</H3>
  477. <PRE>
  478. public static boolean <B>isNumeric</B>(java.lang.String&nbsp;str)</PRE>
  479. <DL>
  480. <DD><p>Checks if the String contains only unicode digits.
  481. A decimal point is a digit and returns true.</p>
  482. <p><code>null</code> will return <code>false</code>.
  483. An empty String ("") will return <code>true</code>.</p>
  484. <pre>
  485. StringUtils.isNumeric(null) = false
  486. StringUtils.isNumeric("") = true
  487. StringUtils.isNumeric(" ") = false
  488. StringUtils.isNumeric("123") = true
  489. StringUtils.isNumeric("12 3") = false
  490. StringUtils.isNumeric("ab2c") = false
  491. StringUtils.isNumeric("12-3") = false
  492. StringUtils.isNumeric("12.3") = true
  493. </pre>
  494. <P>
  495. <DD><DL>
  496. <DT><B>Parameters:</B><DD><CODE>str</CODE> - the String to check, may be null
  497. <DT><B>Returns:</B><DD><code>true</code> if only contains digits, and is non-null</DL>
  498. </DD>
  499. </DL>
  500. <HR>
  501. <A NAME="getDefaultPoolMap()"><!-- --></A><H3>
  502. getDefaultPoolMap</H3>
  503. <PRE>
  504. public static java.util.Map&lt;java.lang.String,org.apache.commons.pool.KeyedObjectPool&gt; <B>getDefaultPoolMap</B>()</PRE>
  505. <DL>
  506. <DD>Helper method which returns a default PoolMap.
  507. TODO: allow for more configuration options?
  508. <P>
  509. <DD><DL>
  510. </DL>
  511. </DD>
  512. </DL>
  513. <HR>
  514. <A NAME="getKeyString(com.googlecode.jmxtrans.model.Query, com.googlecode.jmxtrans.model.Result, java.util.Map.Entry, java.util.List, java.lang.String)"><!-- --></A><H3>
  515. getKeyString</H3>
  516. <PRE>
  517. public static java.lang.String <B>getKeyString</B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Query.html" title="class in com.googlecode.jmxtrans.model">Query</A>&nbsp;query,
  518. <A HREF="../../../../com/googlecode/jmxtrans/model/Result.html" title="class in com.googlecode.jmxtrans.model">Result</A>&nbsp;result,
  519. java.util.Map.Entry&lt;java.lang.String,java.lang.Object&gt;&nbsp;values,
  520. java.util.List&lt;java.lang.String&gt;&nbsp;typeNames,
  521. java.lang.String&nbsp;rootPrefix)</PRE>
  522. <DL>
  523. <DD><DL>
  524. </DL>
  525. </DD>
  526. </DL>
  527. <HR>
  528. <A NAME="getKeyString2(com.googlecode.jmxtrans.model.Query, com.googlecode.jmxtrans.model.Result, java.util.Map.Entry, java.util.List, java.lang.String)"><!-- --></A><H3>
  529. getKeyString2</H3>
  530. <PRE>
  531. public static java.lang.String <B>getKeyString2</B>(<A HREF="../../../../com/googlecode/jmxtrans/model/Query.html" title="class in com.googlecode.jmxtrans.model">Query</A>&nbsp;query,
  532. <A HREF="../../../../com/googlecode/jmxtrans/model/Result.html" title="class in com.googlecode.jmxtrans.model">Result</A>&nbsp;result,
  533. java.util.Map.Entry&lt;java.lang.String,java.lang.Object&gt;&nbsp;values,
  534. java.util.List&lt;java.lang.String&gt;&nbsp;typeNames,
  535. java.lang.String&nbsp;rootPrefix)</PRE>
  536. <DL>
  537. <DD><DL>
  538. </DL>
  539. </DD>
  540. </DL>
  541. <HR>
  542. <A NAME="cleanupStr(java.lang.String)"><!-- --></A><H3>
  543. cleanupStr</H3>
  544. <PRE>
  545. public static java.lang.String <B>cleanupStr</B>(java.lang.String&nbsp;name)</PRE>
  546. <DL>
  547. <DD>Replaces all . with _ and removes all spaces and double/single quotes.
  548. <P>
  549. <DD><DL>
  550. </DL>
  551. </DD>
  552. </DL>
  553. <HR>
  554. <A NAME="getConcatedTypeNameValues(java.util.List, java.lang.String)"><!-- --></A><H3>
  555. getConcatedTypeNameValues</H3>
  556. <PRE>
  557. public static java.lang.String <B>getConcatedTypeNameValues</B>(java.util.List&lt;java.lang.String&gt;&nbsp;typeNames,
  558. java.lang.String&nbsp;typeNameStr)</PRE>
  559. <DL>
  560. <DD>Given a typeName string, get the first match from the typeNames setting.
  561. In other words, suppose you have:
  562. typeName=name=PS Eden Space,type=MemoryPool
  563. If you addTypeName("name"), then it'll retrieve 'PS Eden Space' from the string
  564. <P>
  565. <DD><DL>
  566. </DL>
  567. </DD>
  568. </DL>
  569. <!-- ========= END OF CLASS DATA ========= -->
  570. <HR>
  571. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  572. <A NAME="navbar_bottom"><!-- --></A>
  573. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  574. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  575. <TR>
  576. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  577. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  578. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  579. <TR ALIGN="center" VALIGN="top">
  580. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  581. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  582. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  583. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  584. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  585. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  586. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  587. </TR>
  588. </TABLE>
  589. </TD>
  590. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  591. </EM>
  592. </TD>
  593. </TR>
  594. <TR>
  595. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  596. &nbsp;<A HREF="../../../../com/googlecode/jmxtrans/util/JmxConnectionFactory.html" title="class in com.googlecode.jmxtrans.util"><B>PREV CLASS</B></A>&nbsp;
  597. &nbsp;<A HREF="../../../../com/googlecode/jmxtrans/util/JmxUtils.ProcessQueryThread.html" title="class in com.googlecode.jmxtrans.util"><B>NEXT CLASS</B></A></FONT></TD>
  598. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  599. <A HREF="../../../../index.html?com/googlecode/jmxtrans/util/JmxUtils.html" target="_top"><B>FRAMES</B></A> &nbsp;
  600. &nbsp;<A HREF="JmxUtils.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  601. &nbsp;<SCRIPT type="text/javascript">
  602. <!--
  603. if(window==top) {
  604. document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  605. }
  606. //-->
  607. </SCRIPT>
  608. <NOSCRIPT>
  609. <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
  610. </NOSCRIPT>
  611. </FONT></TD>
  612. </TR>
  613. <TR>
  614. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  615. SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  616. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  617. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  618. </TR>
  619. </TABLE>
  620. <A NAME="skip-navbar_bottom"></A>
  621. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  622. <HR>
  623. <i>Copyright &#169; 2011 Jon Stevens and a gang of pencils. All Rights Reserved. Build version: 199</i>
  624. </BODY>
  625. </HTML>