JavaÏß³Ì
µÚ8Õ ¶àÏß³Ì
±¾ÕÂĿ¼
8.1¡¡²¢·¢ÐÔ¡¢Ïß³ÌÓë¶àÏß³Ì
8.2¡¡»ñµÃÏß³ÌÌåµÄÁ½ÖÖ·½·¨
8.3¡¡Ï̵߳÷¶È
8.1¡¡²¢·¢ÐÔ¡¢Ïß³ÌÓë¶àÏß³Ì
Ò»¡¢²¢·¢ÐԵĸÅÄî
Ä¿Ç°µÄ¼ÆËã»ú²Ù×÷ϵͳ´ó¶àÖ§³Ö²¢·¢ÐÔ£¬¼´¶à¸ö½ø³ÌÊǽ»²æÖ´Ðеģ¬Ò»°ã³Æ¶à½ø³ÌΪϵͳ¼¶²¢·¢¡£
JavaÓïÑÔͨ¹ý³ÌÐò¿ØÖÆÁ÷À´Ö´ÐгÌÐò£¬µ¥¸öµÄÒ»¶Î³ÌÐòÖ´ÐпØÖÆÁ÷³ÆΪÏ̡߳£
¶àÏß³ÌÖ¸µÄÊÇÔÚµ¥¸ö³ÌÐòÄÚ²¿¿ÉÒÔͬʱÔËÐжà¸öÏàͬ»ò²»Í¬µÄÏß³ÌÀ´Ö´Ðв»Í¬µÄÈÎÎñ¡£
Ïß³ÌÓë²Ù×÷ϵͳÖеĽø³ÌÓÐЩÏàËÆ£¬Í¬Ò»Ê±¿Ì²Ù×÷ϵͳÖпÉÒÔÓжà¸ö½ø³ÌÔÚÔËÐУ¬µ«ÊÇÏß³ÌÔò¸ü½øÒ»²½£¬½«²¢·¢Íƽøµ½ÓïÑÔ¼¶£¬ËùÒÔ˵JavaÓïÑÔÖ§³ÖÓïÑÔ¼¶²¢·¢¡£
ÔÚµ¥¸ö³ÌÐòÄÚ²¿Ò²¿ÉÒÔÔÚͬһʱ¿ÌÓжà¸öÏß³ÌÔÚ½øÐв»Í¬µÄÔËËã¡£
¶àÏß³ÌÒ²ÐèҪϵͳͨ¹ý·ÖÅä´¦ÀíÆ÷µÄÔËÐÐʱ¼ä½øÐе÷¶ÈÒÔÌá¸ßÕû¸ö³ÌÐòµÄÔËÐÐЧÂÊ¡£
¶þ¡¢Ï̵߳Ä״̬ÓëÉúÃüÖÜÆÚ
Ò»¸öÏß³ÌÔÚÆäÉúÃüÉú´æʱ¶ÎÄÚµÄÈÎһʱ¿Ì¶¼´¦ÓÚijһÖÖÏß³Ì״̬£¬Ïß³ÌÔÚ´ÓÆäÉúÃü¿ªÊ¼µ½½áÊøµÄʱ¼äÄÚ½«¿ÉÄܾÀú´Ó³öÉú̬µ½ËÀÍö̬µÄ¶àÖÖ״̬£¬Õâ¹¹³ÉÁËËüµÄÉúÃüÖÜÆÚ¡£
Ï̵߳Ä״̬°üÀ¨ÒÔÏÂ7ÖÖ£º
³öÉú̬£¨Born state£©£¬Ò²³ÆΪÐÂỊ̈߳¨New Thread£©¡£
¾ÍÐ÷̬£¨Ready state£©£¬Ò²³ÆΪ¿ÉÔËÐÐỊ̈߳¨Runnable Thread£©¡£
ÔËÐÐ̬£¨Running state£©¡£
ÐÝÃß̬£¨Sleeping state£©¡£
µÈ´ý̬£¨Waiting state£©¡£
×èÈû̬£¨Blocked state£©¡£
ËÀÍö̬£¨Dead state£©¡£
ÌرðµÄÏ̹߳Øϵ£ºÁ½¸öÏ̵߳ēÒÀÀµ” ¹Øϵ¡£
8.2¡¡»ñµÃÏß³ÌÌåµÄÁ½ÖÖ·½·¨
Ï̴߳Ӹù±¾ÉϽ²ÊÇÒ»¶Î³Ì¶È´úÂëÐòÁУ¬»¹ÐèÒªÔÚ³ÌÐòÖÐʵÏÖ¡£
java.lang°üÖж¨ÒåÁËThreadÀ࣬ÊÇJavaÓïÑÔ¶àÏ̳߳ÌÐòÉè¼ÆµÄ»ù´¡ºÍ¹Ø¼ü¡£
ThreadÀàÊÇjava.lang.ObjectÀàµÄÖ±½Ó×ÓÀ࣬ÆäÖж¨ÒåµÄһЩ·½·¨³ÉÔ±Íê³ÉÓëÏß³ÌÓйصIJÙ×÷£º
interrupt() //ÖжÏÏß³Ì
join() //µÈ´ý¸ÃÏß³ÌÖÕÖ¹
join(long millis) //µÈ´ý¸ÃÏß³ÌÖÕÖ¹£¬ÔÚÖ¸¶¨µÄºÁÃëÊýÄÚ
join(long millis, int nanos) //µÈ´ý¸ÃÏß³ÌÖÕÖ¹£¬ÔÚÖ¸¶¨µÄºÁÃ
Ïà¹ØÎĵµ£º
19.1.1. Spring¶Ôlog4jµÄ¼¸¸öÔöÇ¿
×¢Òâ
¸öÈ˽¨Ò鶼²»ÒªÊ¹Óá£
¶¨Ê±Ë¢ÐÂlog4j.properties£¬ÎÞÐëÖØÆô·þÎñÆ÷¸üÐÂlog4jÉèÖá£ËäÈ»ÕâÊǸöJ2EE Best
Practice£¬µ«ÔÚSpringµÄJavaDocÀï×¢Ã÷Á˲»ÍƼöÓÃÓÚÉú²ú»·¾³£¬ÒòΪ·þÎñÆ÷ÖØÆôµÄʱºò£¬ÄÇÌõwatch thread²»»á¹Ø±Õ¡£
½«
log4j.propertiesÎļþ·ÅÔÚWEB-INF/log4j.properti ......
³£³£ÐèÒªµÝ¹éµÄÌæ»»ÎļþÄÚÈÝ£¬Èç×î½üÎÒÏëдÁ˸öjEdit²å¼þ£¬jEditÌṩÁËÒ»¸ö²å¼þÄ£°å£¬ÎÒֻҪȫ²¿Ì滻һϾͳÉÁËÎÒ×Ô¼ºµÄ¹¤³Ì¡£ÔÚlinuxÏ£¬ÕâºÃ°ì£¬shellÀ´¸ã¶¨£¬µ«ÔÚWindowsÏ»òÕß²»ÊìϤshell¾ÍµÃÏëµãÆäËû°ì·¨À´°ìÁË£¬EditPlus¿ÉÒÔ£¬UEÒ²¿ÉÒÔ£¬²»¹ý²»Ì«·½±ãµÄÊÇÎļþÃû²»ºÃÌæ»»£¬ÒÔÇ°¸ø×Ô¼ºÐ´¹ýÒ»¸öС¹¤¾ßÀ´³ÉÅú¸ÄMP3µÄÃû×Ö£ ......
2010-05-16
Èý¡¢½âÎöXMLÎĵµ
l Xerces½âÎöÆ÷¡¢SAXÀàºÍ½Ó¿Ú
l SAXÔĶÁÆ÷
n Ê×ÏÈÒªµÃµ½Ò»¸ö·ûºÏSAX org.xml.sax.XMLReader½Ó¿Ú¹æ·¶µÄÀý×Ó£¬Õâ¸ö½Ó¿Ú¶¨ÒåÁ˽âÎöÐÐΪ²¢ÔÊÐíÉèÖÃijЩÌØÕ÷ºÍÊôÐÔ¡£¸Ã½Ó¿ÚÌæ»»ÁËSAX1.0ÖеÄorg.xml.sax.Parser
import org.apache.xerces.parsers.SAXParser;
import org.xml. ......
ÊýÄêÇ°£¬µ±ºÍÒ»¸öÈí¼þÍŶÓÒ»ÆðÓà Java ÓïÑÔ±àдһ¸öÓ¦ÓóÌÐòʱ£¬ÎÒÌå»áµ½±ÈÒ»°ã³ÌÐòÔ±¶àÖªµÀÒ»µã¹ØÓÚ Java ¶ÔÏóÐòÁл¯µÄ֪ʶËù´øÀ´µÄºÃ´¦¡£
´óÔ¼Ò»ÄêÇ°£¬Ò»¸ö¸ºÔð¹ÜÀíÓ¦ÓóÌÐòËùÓÐÓû§ÉèÖõĿª·¢ÈËÔ±£¬¾ö¶¨½«Óû§ÉèÖô洢ÔÚÒ»¸ö Hashtable ÖУ¬È»ºó½«Õâ¸ö Hashtable ÐòÁл¯µ½´ÅÅÌ£¬ÒÔ±ã³Ö¾Ã»¯¡£µ±Óû§¸ü¸ÄÉèÖÃʱ£¬±ãÖØн« ......
JVMÄÚ´æµÄÉèÖõÄÔÀí
ĬÈϵÄjavaÐéÄâ»úµÄ´óС±È½ÏС£¬ÔÚ¶Ô´óÊý¾Ý½øÐд¦Àíʱjava¾Í»á±¨´í£ºjava.lang.OutOfMemoryError¡£
ÉèÖÃjvmÄÚ´æµÄ·½·¨£¬¶ÔÓÚµ¥¶ÀµÄ.class£¬¿ÉÒÔÓÃÏÂÃæµÄ·½·¨¶ÔTestÔËÐÐʱµÄjvmÄÚ´æ½øÐÐÉèÖá£
java -Xms64m -Xmx256m Test
-XmsÊÇÉèÖÃÄÚ´æ³õʼ»¯µÄ´óС
-XmxÊÇÉèÖÃ×î´óÄܹ»Ê¹ÓÃÄÚ´æµÄ´óС£¨ ......