Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʹÓÃJava NIO±àд¸ßÐÔÄܵķþÎñÆ÷

תÔصØÖ·£ºhttp://www.javaeye.com/topic/40489
´ÓJDK 1.4¿ªÊ¼£¬JavaµÄ±ê×¼¿âÖоͰüº¬ÁËNIO£¬¼´ËùνµÄ“New IO”¡£ÆäÖÐ×îÖØÒªµÄ¹¦ÄܾÍÊÇÌṩÁË“·Ç×èÈû”µÄIO£¬µ±È»°üÀ¨ÁËSocket¡£NonBlockingµÄIO¾ÍÊǶÔselect(Unixƽ̨ÏÂ)ÒÔ¼° WaitForMultipleObjects(Windowsƽ̨)µÄ·â×°£¬ÌṩÁ˸ßÐÔÄÜ¡¢Ò×ÉìËõµÄ·þÎñ¼Ü¹¹¡£
˵À´²ÑÀ¢£¬Ö±µ½JDK1.4²ÅÓÐÕâÖÖ¹¦ÄÜ£¬µ«³Ùµ½Õß²»Ò»¶¨Ã»ÓÐó¦Ð·³Ô£¬NIO¾ÍÌṩÁËÓÅÐãµÄÃæÏò¶ÔÏóµÄ½â¾ö·½°¸£¬¿ÉÒԺܷ½±ãµØ±àд¸ßÐÔÄܵķþÎñÆ÷¡£
»°Ëµ»ØÀ´£¬´«Í³µÄServer/ClientʵÏÖÊÇ»ùÓÚThread per request£¬¼´·þÎñÆ÷Ϊÿ¸ö¿Í»§¶ËÇëÇó½¨Á¢Ò»¸öÏ̴߳¦Àí£¬µ¥¶À¸ºÔð´¦ÀíÒ»¸ö¿Í»§µÄÇëÇó¡£±ÈÈçÏñTomcat£¨Ð°汾Ҳ»áÌṩNIO·½°¸£©¡¢ResinµÈWeb·þÎñÆ÷¾ÍÊÇÕâÑùʵÏֵġ£µ±È»ÎªÁ˼õÉÙ˲¼ä·åÖµÎÊÌ⣬·þÎñÆ÷Ò»°ã¶¼Ê¹ÓÃÏ̳߳أ¬¹æ¶¨ÁËͬʱ²¢·¢µÄ×î´óÊýÁ¿£¬±ÜÃâÁËÏ̵߳ÄÎÞÏÞÔö³¤¡£
µ«ÕâÑùÓÐÒ»¸öÎÊÌ⣺Èç¹ûÏ̳߳صĴóСΪ100£¬µ±ÓÐ100¸öÓû§Í¬Ê±Í¨¹ýHTTPÏÖÔÚÒ»¸ö´óÎļþʱ£¬·þÎñÆ÷µÄÏ̳߳ػáÓÃÍ꣬ÒòΪËùÓеÄÏ̶߳¼ÔÚ´«Êä´óÎļþÁË£¬¼´Ê¹µÚ101¸öÇëÇóÕß½ö½öÇëÇóÒ»¸öÖ»ÓÐ10×Ö½ÚµÄÒ³Ã棬·þÎñÆ÷Ò²ÎÞ·¨ÏìÓ¦ÁË£¬Ö»Óеȵ½Ï̳߳ØÖÐÓпÕÏеÄÏ̳߳öÏÖ¡£
ÁíÍ⣬Ï̵߳ĿªÏúÒ²ÊǺܴóµÄ£¬ÌرðÊÇ´ïµ½ÁËÒ»¸öÁÙ½çÖµºó£¬ÐÔÄÜ»áÏÔÖøϽµ£¬ÕâÒ²ÏÞÖÆÁË´«Í³µÄSocket·½°¸ÎÞ·¨Ó¦¶Ô²¢·¢Á¿´óµÄ³¡ºÏ£¬¶ø“·Ç×èÈû”µÄIO¾ÍÄÜÇáËɽâ¾öÕâ¸öÎÊÌâ¡£
ÏÂÃæÖ»ÊÇÒ»¸ö¼òµ¥µÄÀý×Ó£º·þÎñÆ÷ÌṩÁËÏÂÔØ´óÐÍÎļþµÄ¹¦ÄÜ£¬¿Í»§¶ËÁ¬½ÓÉÏ·þÎñÆ÷µÄ12345¶Ë¿Úºó£¬¾Í¿ÉÒÔ¶ÁÈ¡·þÎñÆ÷·¢Ë͵ÄÎļþÄÚÈÝÐÅÏ¢ÁË¡£×¢ÒâÕâÀïµÄ·þÎñÆ÷Ö»ÓÐÒ»¸öÖ÷Ị̈߳¬Ã»ÓÐÆäËûÈκÎÅÉÉúỊ̈߳¬ÈÃÎÒÃÇ¿´¿´NIOÊÇÈçºÎÓÃÒ»¸öÏ̴߳¦ÀíN¸öÇëÇóµÄ¡£
NIO·þÎñÆ÷×îºËÐĵÄÒ»µã¾ÍÊÇ·´Ó¦Æ÷ģʽ£ºµ±ÓиÐÐËȤµÄʼþ·¢ÉúµÄ£¬¾Í֪ͨ¶ÔÓ¦µÄʼþ´¦ÀíÆ÷È¥´¦ÀíÕâ¸öʼþ£¬Èç¹ûûÓУ¬Ôò²»´¦Àí¡£ËùÒÔʹÓÃÒ»¸öÏß³Ì×öÂÖѯ¾Í¿ÉÒÔÁË¡£µ±È»ÕâÀïÕâÊǸöÀý×Ó£¬Èç¹ûÒª»ñµÃ¸ü¸ßÐÔÄÜ£¬¿ÉÒÔʹÓÃÉÙÁ¿µÄỊ̈߳¬Ò»¸ö¸ºÔð½ÓÊÕÇëÇó£¬ÆäËûµÄ¸ºÔð´¦ÀíÇëÇó£¬ÌرðÊǶÔÓÚ¶àCPUʱЧÂÊ»á¸ü¸ß¡£
¹ØÓÚʹÓÃNIO¹ý³ÌÖгöÏÖµÄÎÊÌ⣬×îΪÆÕ±éµÄ¾ÍÊÇΪʲôûÓÐÇëÇóʱCPUµÄÕ¼ÓÃÂÊΪ100%£¿³öÏÖÕâÖÖÎÊÌâµÄÖ÷ÒªÔ­ÒòÊÇ×¢²áÁ˲»¸ÐÐËȤµÄʼþ£¬±ÈÈçÈç¹ûûÓÐÊý¾ÝÒª·¢µ½¿Í»§¶Ë£¬¶øÓÖ×¢²áÁËдʼþ£¨OP_WRITE£©£¬ÔòÔÚ Selector.select()ÉϾͻáʼÖÕÓÐʼþ³öÏÖ£¬CPU¾ÍÒ»Ö±´¦ÀíÁË£¬¶ø´Ëʱselect()Ó¦¸ÃÊÇ×èÈûµÄ¡£
ÁíÍâÒ»¸öÖµµÃ×¢ÒâµÄÎÊÌâÊÇ£ºÓÉÓÚֻʹÓÃÁËÒ»¸öỊ̈߳¨¶à¸öÏß³ÌÒ²Èç´Ë£©´¦À


Ïà¹ØÎĵµ£º

SUSE10Ï°²×°java JDK1.6

Ò»¡¢°²×°
´´½¨°²×°Ä¿Â¼£¬ÔÚ/usr/javaϽ¨Á¢°²×°Â·¾¶£¬²¢½«Îļþ¿¼µ½¸Ã·¾¶Ï£º
# mkdir /usr/java
1¡¢jdk-6u11-linux-i586.bin Õâ¸öÊÇ×Ô½âѹµÄÎļþ£¬ÔÚlinuxÉÏ°²×°ÈçÏ£º
# chmod 755 jdk-6u11-linux-i586.bin
# ./jdk-6u11-linux-i586.bin
ÔÚ°´ÌáʾÊäÈëyesºó£¬jdk±»½âѹ¡£
³öÏÖÒ»ÐÐ×Ö£ºDo you aggree to the ......

ÀûÓÃJAVA²Ù×÷EXCELÎļþ

JXL.JAR ²Ù×÷ExcelÎļþ¿ªÔ´°ü
ÕâÀï¼òµ¥½²Ð©ÏîÄ¿ÖÐÓõ½µÄһЩ·½·¨£¡£¨ÏîÄ¿µÄ»·¾³ÊÇStruts2 hibernate3 resin3 £©
 // ExcelÎļþ´æ·Å·¾¶
String path = ServletActionContext.getServletContext().getRealPath("")+"userfiles\\train_excel\\text.xls";
// Éú³ÉExcelÎļþ
WritableWorkbook wwb = Workbook.creat ......

java(Web)ÖÐÏà¶Ô·¾¶£¬¾ø¶Ô·¾¶ÎÊÌâ×ܽá

java(Web)ÖÐÏà¶Ô·¾¶£¬¾ø¶Ô·¾¶ÎÊÌâ×ܽá
Ç°ÑÔ£º
 Ç°Ò»¶Îʱ¼ä£¬ÓÉÓÚÔÚ´¦ÀíWebÓ¦ÓÃϵÄÎļþ´´½¨ÓëÒƶ¯µÈ£¬Òò´ËÉæ¼°µ½ºÜ¶à¹ØÓÚjava
ÖÐÏà¶Ô·¾¶£¬¾ø¶Ô·¾¶µÈÎÊÌ⡣ͬʱ£¬¶ÔÓÚWebÓ¦ÓÃÖеÄÏà¶Ô·¾¶£¬¾ø¶Ô·¾¶£¬ÒÔ¼°Java.io.File
ÀàѧϰÁËһϡ£Ò²ÕÒÁËһЩ×ÊÁÏ¡£Ï£Íû´ó¼ÒÓöµ½ÀàËƵÄÎÊÌ⣬¿ÉÒÔ¸üÓÐЧµÄ½â¾ö¡£
========= ......

Java EEºÍDominoϵͳ¼ä¿çÓòSSOµÄʵÏÖ

1. SSOÐèÇó
µ¥µãµÇ¼£¨Single Sign On, SSO£©ÊÇÆóÒµÓ¦Óü¯³ÉÖÐ×î³£¼ûµÄÐèÇó¡£Ò칹ϵͳ¼äÍùÍù¶¼Óи÷×ÔµÄÓû§¹ÜÀíºÍÉí·ÝÑéÖ¤»úÖÆ£¬Îª
±ÜÃâÓû§ÔÚ½øÐÐϵͳÇл»Ê±Æµ·±ÊäÈëÓû§ÃûºÍÃÜÂ룬Òò´Ë±ØÐëҪʵÏÖµ¥µãµÇ¼¡£
2. SSOÔ­Àí
˵µ½SSOµÄÔ­Àí£¬ÏȵÃ˵һ°ãWebÓ¦ÓõÄÉí·ÝÑéÖ¤Ô­Àí¡£WebÉí·ÝÑéÖ¤Ö®ËùÒÔÄܳÉΪÎÊÌâÖ÷ÒªÔÚÓÚHTTPЭÒé ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ