JavaÏß³ÌÖ®Producer
Producer-Consumer PatternµÄ²ÎÓëÕߣº
1. Data²ÎÓëÕß
±»Producer²ÎÓëÕßËù´´½¨£¬²¢ÓÉConsumer²ÎÓëÕßËùʹÓá£
2. Producer£¨Éú²úÕߣ©²ÎÓëÕß
´´½¨Data²ÎÓëÕߣ¬²¢½«Æä´«µÝ¸øChannel²ÎÓëÕß¡£
3. Consumer£¨Ïû·ÑÕߣ©²ÎÓëÕß
´ÓChannel²ÎÓëÕß»ñÈ¡Data²ÎÓëÕß¡£
4. Channel£¨Í¨µÀ£©²ÎÓëÕß
Channel²ÎÓëÕß´ÓProducer²ÎÓëÕß´¦½ÓÊÕData²ÎÓëÕߣ¬²¢½«Æä±£¹ÜÆðÀ´¡£²¢Ó¦Consumer²ÎÓëÕßµÄÒªÇ󣬽«Data²ÎÓëÕß´«ËͳöÈ¥¡£
ΪÁËÈ·±£°²È«ÐÔ£¬Producer²ÎÓëÕßÓëConsumer²ÎÓëÕßÒª¶Ô·ÃÎʽøÐй²ÏíÅų⡣
ÔÚProducer-Consumer PatternÖУ¬¼ç¸º±£»¤°²È«ÐÔʹÃüµÄÊÇChannel²ÎÓëÕß¡£Channel²ÎÓëÕß½øÐÐÏß³ÌÖ®¼äµÄ¹²Ïí»¥³â£¬ÈÃProducer²ÎÓëÕßÄܹ»ÕýÈ·µÄ½«Data²ÎÓëÕßË͵½Consumer²ÎÓëÕßÊÖÉÏ¡£
ÕâÀËäÈ»·ÖÀëÁËProducerºÍConsumerÖ®¼äµÄ½»»¥£¬Producer²ÎÓëÕß²»ÐèÒªµÈConsumer²ÎÓëÕß´¦ÀíÍêData£¬¾Í¿ÉÒÔ¼ÌÐøÈ¥ÖÆÔìÏÂÒ»¸öData£¬Channel²ÎÓëÕß×÷ΪProducerºÍConsumerÖ®¼äµÄ»º³åÇø¡£µ«ÊÇChannel²ÎÓëÕßµÄÈÝÁ¿Ò²ÊÇÓÐÏ޵ģ¬Ò²¾ÍÊÇ˵£¬µ±ConsumerÏû·ÑDataµÄËÙ¶ÈСÓÚProducerÖÆÔìDataµÄËÙ¶Èʱ£¬ChannelÖеÄDataÊýÁ¿»á³ÖÐøÔö¼Ó¡£ÕâÀïÐèÒª¶ÔChannelµÄÈÝÁ¿¼ÓÒÔ¿ØÖÆ£¬·ñÔò¿ÉÄÜ»á×îºóÒòΪÄÚ´æ²»×ã¶øʹµÃProducerÖÆÔì²»³öData¡£¶ÔÓÚProducer²ÎÓëÕßÀ´Ëµ£¬ÔÚChannelÈÝÁ¿²»×ãµÄÇé¿öÏ£¬ÒªÓèÒԵȴý¡£
ÒýÉ꣺
1. ÒòΪChannel²ÎÓëÕßµÄÖн飬ʹµÃProducerºÍConsumerµÄ¶àÌõÏß³Ìе÷ºÏ×÷¡£
Ïß³ÌΪÁËе÷ºÏ×÷£¬ËùÒÔ±ØÐë½øÐй²Ïí»¥³â£¬Ê¹¹²ÏíµÄ¶«Î÷²»±»Ë𻵡£¶øÏ̵߳Ĺ²Ïí»¥³â£¬¾ÍÊÇΪÁËÈÃÏà´¦ºÏ×÷²Å½øÐеġ£
Ï̵߳ĺÏ×÷ÒªÏë“·ÅÔÚÖмäµÄ¶«Î÷”£¬Ï̵߳Ļ¥³âÒªÏë“Ó¦¸Ã±£»¤µÄ¶«Î÷”
2. ÒòΪChannel²ÎÓëÕßµÄÖн飬¿ÉÒÔʹProducerÖÆÔì³öÀ´µÄ¶à¸öDataÒÔ²»Í¬µÄ˳Ðò´«µÝ¸øConsumer¡£
³£¼ûµÄ´«µÝ»úÖÆÓУº
-- ¶ÓÁУ¬ ×îÏÈÊÕµ½µÄÏÈ´«
-- ¶ÑÕ»£¬ ×îºóÊÕµ½µÄÏÈ´«
-- ÓÅÏȶÓÁУ¬ “ÓÅÏÈ”µÄ¶«Î÷ÏÈ´«
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
1.»ù±¾¸ÅÄîµÄÀí½â
¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:xyz est.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸öURL¾ø¶Ô·¾¶¡£
Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚ
ServletÖУ¬ ......
ת×Ôhttp://www.cnblogs.com/liwp_stephen/archive/2008/08/03/1259385.html£¬·Ç³£¸Ðл×÷ÕߵķÖÏí
ʹÓÃAxis±àдWebService±È½Ï¼òµ¥£¬¾ÍÎÒµÄÀí½â£¬WebServiceµÄʵÏÖ´úÂëºÍ±àдJava´úÂëÆäʵûÓÐʲôÇø±ð£¬Ö÷ÒªÊǽ«ÄÄЩJavaÀà·¢²¼ÎªWebService¡£ÏÂÃæÊÇÒ»¸ö´Ó±àд²âÊÔÀý× ......
Groovy supports a few neat ways to work with SQL more easily and to make SQL more Groovy. You can perform queries and SQL statements, passing in variables easily with proper handling of statements, connections and exception handling thanks to closures.
import groovy.sql.Sql
def foo = 'cheese ......