javaÐÔÄܼà¿Ø¹¤¾ß btrace
btraceÊÇsunÍƳöµÄÒ»¿îjavaÐÔÄܼà¿Ø¹¤¾ß£¬ÀûÓÃjava agent ºÍ jvm attach¼¼Êõ£¬¿ÉÒÔ²»Í£»úµÄÇé¿öϼà¿ØÏßÉÏÇé¿ö£¬²¢ÇÒ×öµ½×îÉÙµÄÇÖÈ룬ռÓÃ×îÉÙµÄϵͳ×ÊÔ´¡£
Ïêϸ¼û¹Ù·½Îĵµ
ÁíÍâbtraceÓкÜÑϸñµÄÏÞÖÆ£¬±ÈÈçÆ´½Ó×Ö·û´®¡¢Ñ»·¡¢µÝ¹é¡¢ÒÔ¼°ÎÒÃÇƽʱ¾³£ÓõÄһЩ·½·¨¶¼²»¿ÉÒÔÓã¬ËûÓÐËû×Ô¼º×¨ÃŵÄÀà¿â¡£
btrace»¹ÌṩÁËVisualVM Plugin ÒÔ¼°Netbeans Plugin¡£
¾ßÌåʹÓÃÈçÏ¡£
1.ÏÂÔØbtrace°ü http://kenai.com/projects/btrace/downloads/directory/releases¡£
2.ÉèÖû·¾³±äÁ¿¡£
3.¶¨ÖÆ×Ô¼ºÐèÒªµÄ½Å±¾¡£
4.jpsÃüÁî²é³öÐèÒª¼à¿ØµÄjvm pid¡£
5.µ÷ÓÃÃüÁî btrace <pid> <×Ô¼º¶¨ÖƵĽű¾> <Êä³öÎļþ> eg£ºbtrace 3045 PrintExecuteTime.java > time.log
ÎÒ¾³£Ê¹ÓõŦÄÜÒ»ÊǼà¿ØijЩ·½·¨µÄºÄʱ£¬¶þÊDz鿴ijЩ·½·¨µÄ²ÎÊýÖµ£¬ÈýÊǼà¿ØÄÚ´æʹÓÃÇé¿ö¡£
½Å±¾¾ÙÀýÈçÏÂ
1.¼à¿Ø·½·¨²ÎÊý£¨Êý×飩
Java´úÂë
import static com.sun.btrace.BTraceUtils.print;
import static com.sun.btrace.BTraceUtils.printArray;
import static com.sun.btrace.BTraceUtils.println;
import static com.sun.btrace.BTraceUtils.probeClass;
import static com.sun.btrace.BTraceUtils.probeMethod;
import com.sun.btrace.annotations.BTrace;
import com.sun.btrace.annotations.OnMethod;
@BTrace
public class PrintArgArray {
/**
* ´Ë·½·¨´òÓ¡³öTestÀàÖеÄmergeArray(Long[] arrayOne, Long[] arrayTwo)·½·¨´«ÈëµÄ²ÎÊý
* ²ÎÊýÃû×ÖÒ»¶¨ÒªºÍ¼à¿Ø¶ÔÏóµÄ·½·¨²ÎÊýÃû×ÖÒ»ÖÂ
*
* @param arrayOne ¼à¿Ø²ÎÊýÒ»
* @param arrayTwo ¼à¿Ø²ÎÊý¶þ
* @author jerry
*/
Ïà¹ØÎĵµ£º
ÊʺϳõѧÕßÀí½â
1£¬testflex.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="init()"
minWidth="955 ......
¹¤×÷ÖÐÓöµ½ÐèÒªºÏ²¢XMLµÄÎÊÌ⣬Ëì´ÓÍøÉϲéÕÒÏà¹Ø×ÊÁÏ£¬
1¡¢ ¡¶ XML merging made easy
¡·
2 ¡¢¡¶javaÖкϲ¢xmlÎĵµµÄÉè¼ÆÓëʵÏÖ
¡·
²âÊÔºó·¢ÏÖ¾ù²»·ûºÏʵ¼ÊÐèÇó£¬Êµ¼ÊÐèÇóÈçÏ£º
file1.xml:
<root>
<a>
<b name="1"/>
</a>
<d /& ......
package com.flxx.docUrl;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.List;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;
import org.jdom.output.Format;
import org.jd ......
¶àÏ̶߳Áдͬһ¸ö¶ÔÏóµÄÊý¾ÝÊǺÜÆÕ±éµÄ£¬Í¨³££¬Òª±ÜÃâ¶Áд³åÍ»£¬±ØÐë±£Ö¤ÈκÎʱºò½öÓÐÒ»¸öÏß³ÌÔÚдÈ룬ÓÐÏß³ÌÕýÔÚ¶ÁÈ¡µÄʱºò£¬Ð´Èë²Ù×÷¾Í±ØÐëµÈ´ý¡£¼òµ¥Ëµ£¬¾ÍÊÇÒª±ÜÃâ“д-д”³åÍ»ºÍ“¶Á-д”³åÍ»¡£µ«ÊÇͬʱ¶ÁÊÇÔÊÐíµÄ£¬ÒòΪ“¶Á-¶Á”²»³åÍ»£¬¶øÇҺܰ²È«¡£
ҪʵÏÖÒÔÉϵÄReadWriteLock£¬ ......
³ÌÐòÉè¼ÆÊǽâ¾öÎÊÌâ˼·µÄ¾ßÌ廯.¾ÍÏñ½¨ÔìÒ»×ù·¿×ÓÒ»Ñù£¬ÓÃʲôÑùµÄ²ÄÁÏ,½¨Ôìʲô·ç¸ñµÄ½¨Öþ,¾ßÌåÿ¸öλÖÃÊÇʲô... ²»Í¬µÄ½¨Öþʦ»áÓв»Í¬µÄ·½·¨. ¶ø°ÑÍê³ÉijһÌض¨ÎÊÌâµÄ½â¾ö˼·¹æ·¶Ò»Ï ¾Í¿ÉÒÔ³Æ×÷ΪһÖÖÉè¼Æģʽ.
³ÌÐòÉè¼ÆÖÐÉè¼ÆģʽΪÎÒÃÇÔÚijһÎÊÌâÓòÌṩÁËÒ»ÖÖÁ¼ºÃµÄʵÏÖ·½·¨²Î¿¼£¬¿ÉÒÔ´ó´óʵÏÖ¸´Óú͸ßЧ¡£
ÏÂÃæÎ ......