JXTA——JAVA P2PÍøÂç±à³Ì¼¼Êõ£¨ÈëÃÅƪ£©
1£®Ç°ÑÔ
×î½ü£¬P2P£¨Peer-to-Peer£©ÓÖ³ÉΪÁËÒòÌØÍøÉϵÄÒ»¸öÈȵ㡣P2PÊÇÒòÌØÍøµÄÒ»ÖÖÓ¦ÓÃģʽ£¬ÆäÒâ˼ÊÇÖ¸ÍøÂçÉϵÄÈκÎÉ豸£¨°üÀ¨´óÐÍ»ú¡¢PC»ú¡¢PDA¡¢ÊÖ»ú¡¢»ú¶¥ºÐµÈµÈ£©¶¼¿ÉÒÔƽµÈµØÖ±½Ó½øÐÐÁ¬½Ó²¢½øÐÐÐ×÷¡£Ïë±Èµ±Ç°ÒòÌØÍøÉÏÖ÷Á÷µÄÓ¦ÓÃģʽClient/Server»òÕßClient/Service¶øÑÔ£¬P2P¾ßÓÐ×Ô¼ºÏÊÃ÷µÄÌصãºÍÓÅÊÆ¡££¨ÕâÒ²ÊÇÎÒ¶ÔËü×ÅÃԵĵط½¡£ºÇºÇ……J£©
ÓÐÁËP2P¼¼Êõ£¬ÒòÌØÍø²»ÐèÒªÒ»¸ö´óÐ͵ķþÎñÆ÷£¬Õâ¶ÔÓÚÓÐЩÐÐÒµ£¨ÓÈÆäÊÇÍøÂçÓÎÏ·£©À´Ëµ£¬ÊǷdz£“ÐÒÔË”µÄ£¡ÒòΪP2P¼¼Êõ¶¼ºÜ·½±ãµÄʵÏÖÄãÖ»»¯ºÜÉÙµÄmoney¾Í¿ÉÒÔ´ïµ½ÄãÏëÒªµÄЧ¹û¡££¨ÊDz»ÊÇÐĶ¯ÁË£¿ºÇºÇ……J£©
һЩ³£¼ûµÄP2PÓ¦ÓóÌÐò£ºÁÄÌì³ÌÐò£¬ÓÎÏ·£¨ÓÈÆäÍøÂçÓÎÏ·£©£¬Îļþ¹²Ïí£¬Ðͬ¹¤×÷ºÍ°×°å¡£
µ±È»£¬P2PÍøÂçÒ²Ó¦¾ß±¸µÄÏÂÁÐÌص㣺
¢Ù »¥²Ù×÷ÐÔ£ºP2PϵͳºÜÈÝÒ×µÄÕÒµ½²¢Á¬½Ó¶Ô·½£¬±Ë´Ë½øÐн»Á÷¡£
¢Ú ƽ̨ÎÞ¹ØÐÔ£ºP2PϵͳӦ¸ÃÉè¼Æ³É¶ÀÁ¢ÓÚ±à³ÌÓïÑÔÈçC£¬JavaµÈ£¬¶ÀÁ¢ÓÚϵͳƽ̨ÈçWindowsºÍUNIX£¬¶ÀÁ¢ÓÚÍøÂçƽ̨ÈçTCP/IPºÍBLUETOOTH¡£
¢Û ¹ã·ºÐÔ£ºP2Pϵͳ¿ÉÒÔÔËÐÐÔÚÈκÎÓÐÊý×Ö´¦Àí¹¦ÄܵÄÉ豸ÉÏ¡£
2£®JXTAÊÇʲô
Ê×ÏÈ£¬JXTAÊÇΪÁ˹¹½¨P2PÍøÂç¶øÖƶ©µÄÒ»×éÐÒ飬Êǽâ¾ö¹¹½¨P2PÍøÂç±ØÐëÒª½â¾öµÄÎÊÌâµÄ·½·¨¡£¹²ÓÐÁù¸öÐÒ飨¹ØÓÚÕâЩÐÒéºóÃæ»áÏêϸµÄ̸µÄ£©¡£
Æä´Î£¬JXTAÊÇP2PÓ¦ÓóÌÐò¿ª·¢µÄÔËÐÐƽ̨¡£Ä¿Ç°£¬JXTAÊ×ÏÈÍƳöÁË»ùÓÚJavaµÄ²Î¿¼ÊµÏֵġ£
ËüÈý²ã×é³É£ºÈçͼ1-1Ëùʾ£º
ͼ1-1 JXTAµÄ²ã´Î½á¹¹
µÚÒ»²ãÊÇJXTAºËÐIJ㣬Ëü°üº¬ÁË·þÎñËù±ØÐèÒªµÄºËÐŦÄÜ£¬°üÀ¨Peer¡¢¶ÔµÈ×é¡¢Peer·¢ÏÖ¡¢PeerͨÐÅ¡¢Peer¼àÊÓºÍÏà¹ØµÄ°²È«ÔÓµÚ¶þ²ãÊÇ·þÎñ²ã£¬ËüÌṩÁË·ÃÎÊJXTAÐÒéµÄ½Ó¿Ú£¬°üÀ¨¶ÔÓÚP2PÍøÂç²»ÊDZØÐèµÄ£¬µ«ºÜͨÓõŦÄÜ£¬Èç²éÕÒ¡¢¹²Ïí¡¢Ë÷Òý¡¢´úÂ뻺´æºÍÄÚÈÝ»º´æµÄ»úÖÆ£»µÚÈý²ãÊÇÓ¦Óò㣬ËüʹÓ÷þÎñÀ´·ÃÎÊJXTAÍøÂçºÍJXTAÌṩµÄ¹¦ÄÜ£¬°üÀ¨ÁËÓ¦ÓÃJXTA·þÎñ¿ª·¢³öÀ´µÃÍêÕûµÄP2PÓ¦ÓóÌÐò£¬ÈçmyJXTA£¬JXTA-CADµÈÓ¦ÓóÌÐò¡£
ÏÂÃæ¼òÂԵĽéÉÜÒ»ÏÂJXTAµÄһЩ¸ÅÄî°É£º
3£®JXTAµÄһЩ¸ÅÄî
Peer£¨¶ÔµÈ»ú£
Ïà¹ØÎĵµ£º
½á¹¹Ä£Ê½£¨££©
Adapter(ÊÊÅäÆ÷)
½«Ò»¸öÀàµÄ½Ó¿Úת»»³É¿Í»§Ï£ÍûµÄÁíÍâÒ»¸ö½Ó¿Ú¡£AdapterģʽʹµÃÔ±¾ÓÉÓÚ½Ó¿Ú²»¼æÈݶø²»ÄÜÒ»Æð¹¤×÷µÄÄÇЩÀà¿ÉÒÔÒ»Æð¹¤×÷¡£
Adapter·ÖΪ2ÖÖ:
ÀàÊÊÅäÆ÷ºÍ¶ÔÏóÊÊÅäÆ÷¡£AdapterºÍAdapteeÖ®¼äÊÇis-a¹ØϵµÄʱºò£¬ÊôÓÚÀàÊÊÅäÆ÷£¬AdapterºÍAdapteeÖ®¼äÊÇhas-a¹ØϵµÄʱºò£¬ÊôÓÚ¶ÔÏóÊÊÅäÆ÷¡£ ......
JAVAËÄÖÖ»ù±¾ÅÅÐò,°üÀ¨Ã°ÅÝ·¨,²åÈë·¨,Ñ¡Ôñ·¨,SHELLÅÅÐò·¨.ÆäÖÐÑ¡Ôñ·¨ÊÇðÅÝ·¨µÄ¸Ä½ø,SHELLÅÅÐò·¨ÊÇ ²åÈë·¨µÄ¸Ä½ø.ËùÒÔ´Ó¸ù±¾ÉÏÀ´Ëµ¿ÉÒÔ¹éÄÉΪÁ½ÖÖ²»Í¬µÄÅÅÐò·½·¨:¼´:²åÈë·¨£¦Ã°ÅÝ·¨
Ò» ²åÈë·¨:±éÀúÅÅÐò¼¯ºÏ£¬Ã¿µ½Ò»¸öÔªËØʱ£¬¶¼Òª½«Õâ¸öÔªËØÓëËùÓÐËü֮ǰµÄÔªËرéÀú±È½ÏÒ»±é£¬È÷ûºÏÅÅÐò˳ÐòµÄÔªËØ°¤¸öÒƶ¯µ½µ±Ç°·¶Î§ÄÚËü×î ......
±¾ÎÄ·ÖÊ®ËĸöÀà±ð¶ÔÕýÔò±í´ïʽµÄÒâÒå½øÐÐÁ˽âÊÍ£¬ÕâÊ®Ëĸ÷Àà±ðÊÇ£º×Ö·û/×Ö·ûÀà/Ô¤¶¨Òå×Ö·ûÀà/POSIX×Ö·ûÀà/java.lang.CharacterÀà/Unicode¿éºÍÀà±ðµÄÀà/±ß½çÆ¥ÅäÆ÷/GreedyÊýÁ¿´Ê/ReluctantÊýÁ¿´Ê/PossessiveÊýÁ¿´Ê/LogicalÔËËã·û/BackÒýÓÃ/ÒýÓÃ/ÌØÊâ¹¹Ôì¡£
1.1.×Ö·û
x ×Ö·û x¡£ÀýÈça±íʾ×Ö·ûa
\\&nbs ......
È·¶¨ÄãµÄjdk»·¾³±äÁ¿ÅäÖÃÊÇÕýÈ·µÄ¡£
¶ÔÓÚjava³õѧÕßÀ´Ëµ£¬±àÒëºÍÔËÐÐjava³ÌÐòÊÇÒ»¼þºÜÍ·Ì۵Ķ«Î÷¡£
ÏÔÈ»£¬ÔÚÃüÁʽϱàÒëºÍÔËÐÐjava³ÌÐòÓþÃÁË£¬È·ÊµÊǺÜÂé·³£¬
¶øÎÒÃÇÓÖ²»ÏëʹÓôóÐ͵Ŀª·¢¹¤¾ßʱ£¬UltraEditÊÇÒ»¸ö²»´íµÄÑ¡Ôñ£¬
ºÜ¶à³õѧÕ߶¼ÊÇÓÃËüÀ´±àдjavaÔ´ÎļþµÄ£¬¿ÉÒÔ¸ßÁÁ¶ÈÏÔʾ¹Ø¼ü×Ö¡£
1¡£¹Ø¼ü×Ö¸ßÁÁ¶ÈÏÔʾ¡ ......
JAVAÖÐStringÓëStringBuffer ¡¢StringBuilderµÄÇø±ð
Ò»¡¢StringºÍStringBufferµÄÇø±ð
ÔÚjavaÖÐÓÐ3¸öÀàÀ´¸ºÔð×Ö·ûµÄ²Ù×÷¡£
1.Character ÊǽøÐе¥¸ö×Ö·û²Ù×÷µÄ£¬
2.String ¶ÔÒ»´®×Ö·û½øÐвÙ×÷¡£²»¿É±äÀà¡£
3.StringBuffer Ò²ÊǶÔÒ»´®×Ö·û½øÐвÙ×÷£¬µ«ÊǿɱäÀà¡£
StringÊôÐÔ:
*ÊǶÔÏó²»ÊÇÔʼÀàÐÍ.
*Ϊ²»¿É±ä¶ÔÏó,Ò»µ© ......