pushlet Ö®ÏûϢ֪ͨ
×î½ü×öÍêÒ»¸öÓû§ÉÏ´«ÊÓƵÎļþ£¬ÔÚ·þÎñÆ÷Íê³ÉתÂëµÄ·þÎñ¡£¸ù¾ÝÐèÒªÉè¼ÆÁËÒ»¸ö¼òµ¥µÄÏûϢ֪ͨϵͳ£¬Ê¹ÓÃpushletʵÏÖ¡£ÈçÓдíÎ󣬻¶ÓÖ¸Õý£¬·Ç³£¸Ðл¡£
[×ÊÔ´]
¹Ù·½ÍøÕ¾£ºhttp://www.pushlets.com/ ÏÂÔص½pushletµÄjar°ü£¬½âѹºó¿ÉÒÔ¿´µ½¹Ù·½µÄÀý×Ó¡£
ÔÚʵ¼ùÖвο¼ÁËpushlet-2.0.4\webapps\pushlet\examples\ajax\ajax-2.htmlµÄÀý×Ó
µÚÒ»²½
½«pushlet.jar·Åµ½¹¤³ÌµÄlibĿ¼ÖУ¬½«pushlet-2.0.4\webapps\pushlet\lib\js-pushlet-client.js·Åµ½ÍøÒ³ÄÜ·ÃÎʵÄĿ¼£¬½«pushlet-2.0.4\webapps\pushlet\WEB-INF\classes\pushlet.propertiesºÍpushlet-2.0.4\webapps\pushlet\WEB-INF\classes\sources.properties¿½±´µ½¹¤³ÌĿ¼µÄclassesĿ¼Ï¡£
µÚ¶þ²½
ʹÓÃpushletsÔÚÍøÒ³¿Í»§¶ËÖÐÅäÖ÷dz£¼òµ¥
ÔÚÍøÖÐÒ³ÃæÒýÓÃÈçÏ´úÂë
µÚÈý²½
ÔÚ¹¤³ÌµÄweb.xmlÖÐÌí¼ÓÅäÖÃÈçÏÂString subject = "/pushlet/ping"Event event = Event.createDataEvent(subject);event.setField("msg", "ping.....");PvmsEncodeMessage.MSG_MESSAGE_COUNT);Dispatcher.getInstance().multicast(event);
×ܽ᣺
ÔÚʹÓõĹý³ÌÖÐÓöµ½ÁËÈô¸ÉÎÊÌâ
1.ÔõôʵÏÖ¸ù¾ÝÓû§À´ÍÆËÍÏûÏ¢
ÎÒÔÚʵÏÖµÄʱºòΪ²»Í¬µÄÓû§¶¨Ò岻ͬµÄtopic£¬¸ù¾ÝÓû§idÀ´Çø·Ö¡£¿´ÁËÎĵµ½éÉÜ£¬Ëµ¿ÉÒÔ°ó¶¨pushletµÄsession£¬Ã»Ñо¿Ã÷°×¾ßÌåÔõô²Ù×÷¡£ÎÒµÄʵÏÖ·½Ê½È±µãÊÇ£¬Èç¹û·þÎñÆ÷ÖØÆô»òÕßÏûÏ¢·¢ËÍʧ°Üµ¼ÖÂpushletµÄsession¹Ø±Õ£¬ÄÇôºóÐøµÄÏûÏ¢¾Íû°ì·¨·¢Ë͸øÓû§¡£
2.·¢ËÍÀëÏßÏûÏ¢
ÎÒ°ÑÏûÏ¢´æÔÚ·þÎñÆ÷£¬Ö»ÓÃpushletÀ´·¢Ë͵±Ç°µÄÏûÏ¢ÊýÁ¿¡£±ÈÈçÔÚÓû§µÇ¼ºó£¬·¢Ë͸øÓû§Ò»ÌõÏûÏ¢¸æËßÓû§ÓжàÉÙÌõδ¶ÁÏûÏ¢£¬Óû§¿ÉÒÔÊÖ¶¯±ê¼ÇÏûϢΪÒѶÁ»òÕßɾ³ýÏûÏ¢¡£