??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品久久亚洲一区二区,亚洲综合另类小说色区,亚洲日韩亚洲另类激情文学http://m.tkk7.com/scud/archive/2020/04/20/435381.htmlScud(飞云侠)Scud(飞云侠)Mon, 20 Apr 2020 03:08:00 GMThttp://m.tkk7.com/scud/archive/2020/04/20/435381.htmlhttp://m.tkk7.com/scud/comments/435381.htmlhttp://m.tkk7.com/scud/archive/2020/04/20/435381.html#Feedback0http://m.tkk7.com/scud/comments/commentRss/435381.htmlhttp://m.tkk7.com/scud/services/trackbacks/435381.htmlhttps://blog.cnscud.com 谢谢博文

Scud(飞云侠) 2020-04-20 11:08 发表评论
]]>
2014西12天自助自驾游http://m.tkk7.com/scud/archive/2014/03/26/411528.htmlScud(飞云侠)Scud(飞云侠)Wed, 26 Mar 2014 11:21:00 GMThttp://m.tkk7.com/scud/archive/2014/03/26/411528.htmlhttp://m.tkk7.com/scud/comments/411528.htmlhttp://m.tkk7.com/scud/archive/2014/03/26/411528.html#Feedback0http://m.tkk7.com/scud/comments/commentRss/411528.htmlhttp://m.tkk7.com/scud/services/trackbacks/411528.html在那? 我们微笑着生活~~~~

 

点击查看大图

 

 

索引:

旧金?/a>

旧金pL?/a>
一号公? ?/a>不胜?br /> * z杉?  游荡, 环球影城, 奥特莱斯
佩吉: 路上, 马蹄? 羊?/a>
大? Xq一遇的大雪!!??
尝拉斯l加?/a>

 

 

天数1: 当地12? 包括往q?13?

天数2: 14?/span>

 

出发0: 2014.1.27  北京/上v

q回1: 2014.2.8, 2.9北京落地

q回2: 2014.2.10, 2.11上v落地

 

ȝ机票1:  北京->襉K?>旧金?   q程机票1: 拉斯l加?>襉K?>北京

ȝ机票2:  上v->温哥?>旧金?   q程机票1: 拉斯l加?>温哥?>北京

 

 

行程路线: 

1. 到达旧金? 附近闲?(因ؓ晚点, 所以没?

2. 旧金׃?(2?: l典景点+"谷+斯坦? +伯克?/p>

3. 一号公??: 无敌太^z? 卡梅? 17公里, 业w? 莫罗? 马里?/p>

4. z杉?? l典景点, 环球影城, 奥特莱斯购物

5. z杉?>拉斯l加?1?: 路上, 各种J华赌城

6. 拉斯l加?>佩吉->大?>拉斯l加?3?: 鲍威湖, 马蹄? 羊? 大?/p>

7. 部分: 拉斯l加??: UR金迷

8. 拉斯l加斯返E?/p>

 

点击查看大图

 

 

队友: 四个? 两家? 两h会开? 一个h外语相对? 一个h功课做的比较?/p>

 

行程设计: ׃界邦旅行|?( www.shijiebang.com ) 的达?荔枝 全程提供设计q多ơ改q?/span>

点击查看大图
点击查看大图
 

 

归来的行E体? 比较利的行E? 心情略有紧张, 收获非常? 都不惛_来了~~~ 哈哈

 

在那? 我们永远应该微笑着生活~~~~

 

 

先说从北京去旧金? 从西雅图转机的过E?/span>

主要的注意事Ҏ
1. 熟悉北京首都机场, 主要是ؓ了免E店购物, 其他什么的不用担心, 毕竟q在国内, 只要不带危险品就没什么问? 刀啊液体啊什么的走托q?br /> 2. 熟悉襉K图机? 因ؓ襉K图是国入境, 要过UL? 关, TSA什么的, 耗费旉可能会比较多
    如果是第一ơ去, 中{旉q是多留点好, 毕竟ҎE以及机场都不熟悉的

 

贴下襉K图机场的转机程:  (全文在此: http://www.hnair.com/HNAIRNETDOCS/PRODUCT/SpecialOffer/xyt_zzlc.html )

 

我只贴我们的: 行李条上除了标明到西雅图Q还标明到最l目的站的{\U?/u>Q?/span>

    旅客下机→接受UL局?#8594;提取托运行李→接受关?#8594;左{行李递交中{服务人员→TSA安全?#8594;C转显C屏Q查看联E段航班号及L口)→前往中{L口(SL区)或乘电R到达中{L口(除SLZ外的其他L口)→L口办理联E航D늙机牌→L?/span>

 

大家注意q个 "左{行李递交中{服务人员" , 其实q个不一定有? 特别是晚Ҏ者入境时间比较长的情况下, 我们因ؓ晚点(中国航空,你懂? 没事晚?  是问了一? 自己把行李放C转行李的传送带上的.  (此处收获 "自助? l验500?:P  ) 

 

襉K图机?  因ؓ我们改签, 所以多?个小?把机场的A B C D N S逛了个遍, 火车做了好多次, 一炚w不麻?哈哈

 

点击查看大图

 

襉K图机场地? (|上来的, 我也照了) 

点击查看大图

 

 

 

我们是乘坐v南航I公司的 HU495 航班到达襉K? 然后原计划做 Alaska AS318 L金山? 因ؓ晚点, 本来?个小时的中{旉, 但我们只有一个小时了, 因ؓ入境关, 以及转航站楼, 旉来不?  最l去 Alaska 的柜台改{了下一班飞?(4个半时?, 所以要量安排好缓冲时? 避免酒店和落地后的交通出现问? 我们因ؓ是旧金山乘坐公共交? 所以一切还?

 

C旧金? 因ؓ功课做的? 我们乘坐机场轻轨, 然后做了BART, 然后转F路公交R, 利到达渔h码头喜来登酒?  (此处收获 "自助? l验3000?:P  ) 

 

BART其实很容易买的, 我觉得他是针对工程师思维设计?(毕竟是硅?, 所以我用v来很Ҏ׃了俩张票. so easy.  (此处收获 "自助? l验500?:P  ) 

 

BART的地? 

点击查看大图
 

 

 

期间12天单写文章再?........ 再说说从拉斯l加斯经q西雅图q回北京:

 

 

我们在拉斯维加斯定了一个接送的? 其实在拉斯维加斯打R到机场非常容? 出租车非常多 24时都很多的 (当然hE贵), 我们接送的车凌?:50如约到达, L对上"暗号", 20分钟不到到达了机场, 因ؓ从拉斯维加斯到西雅图机场是美国国内航D? 我们无聊地在机场呆了2个多时, 也没有免E店....... 早知道多睡一会了~~~

 

国国内的航班没事不会晚? 所以我们就利C襉K? 在西雅图..................... 啥也没干........ (没有出境, 没有关, 没有再次安检)  q南航空?HU496 ?.......... 

 

说v南航空(或者说中国的航? 真是无语? 可能是因为只有一个航班的原因, 实力太弱? q个柜台也没? 目前是和辄航空合作使用柜台?可能一D|间变一?, 但是q个牌子也没? 我们边等辚w了90分钟, 才敢认是在S1柜台换登机牌, 南航空的服务意识简直就?........?, 去问他们的服务h? 是...那个牌子啊是应该有的?....但是........ M费旉   (此处收获 "吐槽" l验1000?:P  )   

 

标准程: 旅客下机→中{旅客前往SL口(非S区域下机旅客可乘电R前往SL区域Q?#8594;到达SL?#8594;在SL口办理西雅图-北京的登机牌Q确认中转行?#8594;旅客L?/p>

 

 

襉K图机场的免税店有6个小航站? 因ؓ不太认L牌的事情, 也就单逛了一下免E店, C一些东?.....   C西是需要看护照和登机牌? 店员会把你买的东襉K到L口的, L的时候别忘了?.......  (此处收获 "自助? l验500?:P  ) 

 

对了, 我们在西雅图机场q吃了一中?.... google maps 又立功了  (此处收获 "自助? l验1000?:P  ) 

 

然后L, Z用餐 看电? .....熬过10个小? 利到达北京.......

 

接受中国的检? 辚w, 关...........  关因ؓ人太? 所以是抽检? 本来q担心买了ipad要不要上E? l果也没人查?....顺利过关了...... 我后面的女生去查包?.....good luck

 

拿行? 发现丢了一个TSA的锁.....那也q?...几毛q事情...... 行李里塞了一张TSA安全查的通知, 也就是说你的包被查了........

 

 

然后?逛机场的免税? 可以买y克力 烟酒  手表  化妆?.....好多人在?..... 抢手的东?例如化妆?要狠E_, 否则可能一会就没了........... 或者要排很长的队伍ȝ?...... 

 

免税店买东西要出C登机牌? 否则........q是可以买y克力?.....

 

点击查看大图
 

 

出机? 打R, 见到路边的中文字.......

 

兴奋? 又吸到雾霾了

 

 

何时再去国? for ever 不回? (此处收获 "梦想" 累积?0000?:P  ) 

 

 

 

 

各位马q马上成?/p>

 

点击查看大图

 

 

 

 

游记索引:

旧金?/a>

旧金pL?/a>
一号公? ?/a>不胜?br /> z杉?  游荡, 环球影城, 奥特莱斯
佩吉: 路上, 马蹄? 羊?/a>
大? Xq一遇的大雪!!??
尝拉斯l加?/a>

 

 

具体行程l节PPT和行E单, h我烦? 邮箱 cnscud#gmail.com 

 



Scud(飞云侠) 2014-03-26 19:21 发表评论
]]>
北京出国自助游旅游网站世界邦高薪招聘 前端, Java, 试工程?/title><link>http://m.tkk7.com/scud/archive/2013/09/05/403719.html</link><dc:creator>Scud(飞云侠)</dc:creator><author>Scud(飞云侠)</author><pubDate>Thu, 05 Sep 2013 08:39:00 GMT</pubDate><guid>http://m.tkk7.com/scud/archive/2013/09/05/403719.html</guid><wfw:comment>http://m.tkk7.com/scud/comments/403719.html</wfw:comment><comments>http://m.tkk7.com/scud/archive/2013/09/05/403719.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/scud/comments/commentRss/403719.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/scud/services/trackbacks/403719.html</trackback:ping><description><![CDATA[<div></div><div>世界邦旅行网Qwww.shijiebang.comQ是一个新型出境自助旅行社区和电子商务开攑^収ͼ以提?#8220;个性化行程定制服务Q高性h比、高质量境外自助?#8221;为目标?/div><div>世界邦的服务宗旨是:更好的服务于出境自助游旅行者,提高亿万国h的旅行质量?/div><div></div><div></div><div>世界邦(北京Q信息技术有限公怺2012q底创立Q集l国内各大著名互联网公司与出境旅游行业精英,创立伊始便得到国际顶U风投注资?/div><div></div><div>世界邦旅行网Qwww.shijiebang.comQ区别于传统旅游论坛与媒体,致力于打通境外服务提供商与旅行者之间的传统壁垒Q搭建帮助千万旅行者实现高性h比、高品质出境自助游的新型旅行C֌和电子商务开攑^収ͼ从而推动出境游领域的业升U。世界邦旅行商城“Travel Mall”Q作一全新概念的旅行服务与商品交易q_Q本w不直接售卖商品Q而是由^C汇集的数癑֮境内外商家提供旅行商品和服务Q世界邦提供交易q_和第三方交易担保Q且提供{证教室、行E设计、甄选比仗随行工L独特服务Q以满旅行者在出境游咨询、规划行E、品选购{各斚w的需求?/div><div>此外Q世界邦旅行|还們ֿ打造旅行者与旅行达h、旅行机构、旅行服务提供商之间的互动交^収ͼ共同分n旅行l验、发现旅行精彩!</div><div></div><div></div><div>薪水范围: 向业界看? 无上? 具体面议</div><div>联系邮箱: felixzhang@shijiebang.net  qq: 104188</div><div></div><div>利: 大厨做饭+交通通讯补助+旅游基金</div><div>  </div><div>  </div><div>职位4: 高JAVA工程?架构?/div><div>1.<span style="white-space:pre"> </span> 有互联网|站开发经验最?例如Zh, 新浪微博, QzonecM|站) </div><div>2.<span style="white-space:pre"> </span> 有创新能? 有独立思想 </div><div>3.<span style="white-space:pre"> </span>较好的沟通能? 团队协作能力 </div><div>4.<span style="white-space:pre"> </span>非常熟悉互联|网站的开发, 了解整个|站的组l和架构</div><div>5.<span style="white-space:pre"> </span>非常熟悉Java语言中和互联|开发相关的知识</div><div>6.<span style="white-space:pre"> </span>熟悉常用开发框Ӟ 例如Spring Framework或类似框?/div><div>7.<span style="white-space:pre"> </span>熟悉Mysql或类似数据库Q?对NOSQL相关领域有了?/div><div>8.<span style="white-space:pre"> </span>对缓存系lMemcache, redis{有一定的使用l验</div><div>9.<span style="white-space:pre"> </span>有钻研精, Ҏ知的领域有深入探索,学习的激?/div><div>10.<span style="white-space:pre"> </span> 快速学习,了解业界最新动态,不断提升自我</div><div>11.<span style="white-space:pre"> </span>热爱旅游, 热爱摄媄优先考虑 </div><div>  </div><div></div><div>  </div><div>职位3: 高前端工程?/div><div>•   有大中型交互性网站品经?例如Zh, 新浪微博, QzonecM|站) </div><div>•   有创新能? 有独立思想 </div><div>•   较好的沟通能? 团队协作能力 </div><div>•   非常熟悉互联|网站的JS开发, 能开发相兛_中型|站的整个前端架?/div><div>•   非常熟悉互联|网站的CSS开发,面制作Q?Ҏ览器兼容性有深刻认识</div><div>•   Ҏ个网站的前端开发工作有l筹规划的经?/div><div>•   热爱旅游, 热爱摄媄优先考虑 </div><div></div><div></div><div>想了解详l信? 可以加我QQ详聊.</div><img src ="http://m.tkk7.com/scud/aggbug/403719.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/scud/" target="_blank">Scud(飞云侠)</a> 2013-09-05 16:39 <a href="http://m.tkk7.com/scud/archive/2013/09/05/403719.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux-自搭|关http://m.tkk7.com/scud/archive/2013/01/10/394044.htmlScud(飞云侠)Scud(飞云侠)Wed, 09 Jan 2013 16:01:00 GMThttp://m.tkk7.com/scud/archive/2013/01/10/394044.htmlhttp://m.tkk7.com/scud/comments/394044.htmlhttp://m.tkk7.com/scud/archive/2013/01/10/394044.html#Feedback0http://m.tkk7.com/scud/comments/commentRss/394044.htmlhttp://m.tkk7.com/scud/services/trackbacks/394044.html阅读全文

Scud(飞云侠) 2013-01-10 00:01 发表评论
]]>
qo讉K日志里的无效ip和robothttp://m.tkk7.com/scud/archive/2013/01/09/394043.htmlScud(飞云侠)Scud(飞云侠)Wed, 09 Jan 2013 15:56:00 GMThttp://m.tkk7.com/scud/archive/2013/01/09/394043.htmlhttp://m.tkk7.com/scud/comments/394043.htmlhttp://m.tkk7.com/scud/archive/2013/01/09/394043.html#Feedback0http://m.tkk7.com/scud/comments/commentRss/394043.htmlhttp://m.tkk7.com/scud/services/trackbacks/394043.html
#!/bin/sh
#定时更新公司IP, 以用来过?br /> #author: Felix Zhang
#date: 2012-12-29

filedir=/opt/logdata/companyip

adate=$(date -d "today" +"%Y%m%d")
filename="${filedir}/ip.${adate}"
ip=`/usr/bin/host yourcompany.3322.org|awk '{print $4}'`
if [ '' != "`grep $ip ${filename}`" ]; then
    exit 0
fi

echo "$ip" >> ${filename}


#Set how long you want to save
save_days=30

#delete 30 days ago nginx log files
find ${filedir} -mtime +${save_days} -exec rm -rf {} \; 

分析日志的脚?


#!/bin/sh
ipdir=/opt/logdata/companyip
adate=$(date -d "today" +"%Y%m%d")
ipfile="${ipdir}/ip.${adate}"
ipreg="127.0.0.1"
if [ -e ${ipfile} ]; then
        ipreg=`cat ${ipfile} |sed ':a N;s/\n/|/;ta'`
        echo "1"
fi
if [ "${ipreg}" = ""  ]; then
   ipreg="127.0.0.1"
   echo "2"
fi
echo ${ipreg}
#cat ip.test |grep -E -v  '127.0.0.1|126.23.23.44'
fileName=$1;
echo '分析文g'$fileName

cat $fileName | egrep  -v ${ipreg} |awk '{print $7}'

q样分析日志时就可以qo掉自己公司的IP? 当然Ҏ机器人的特征也可以过滤机器h, 此处不在多说? 此处仅给出几个机器h

cat ${logfile} |grep -E -v ${ipreg} |grep -E -v "DNSPod-monitor|bot.htm|spider.htm|webmasters.htm" >${cleanlogfile}





Scud(飞云侠) 2013-01-09 23:56 发表评论
]]>
创业公司招聘Java工程? 架构? 资深前端http://m.tkk7.com/scud/archive/2012/09/09/387350.htmlScud(飞云侠)Scud(飞云侠)Sun, 09 Sep 2012 13:04:00 GMThttp://m.tkk7.com/scud/archive/2012/09/09/387350.htmlhttp://m.tkk7.com/scud/comments/387350.htmlhttp://m.tkk7.com/scud/archive/2012/09/09/387350.html#Feedback7http://m.tkk7.com/scud/comments/commentRss/387350.htmlhttp://m.tkk7.com/scud/services/trackbacks/387350.html

联系邮箱: felixzhang@shijiebang.net  qq: 104188

世界邦旅行网Qwww.shijiebang.comQ是一个新型出境自助旅行社区和电子商务开攑^収ͼ以提?#8220;个性化行程定制服务Q高性h比、高质量境外自助?#8221;为目标?/p>

世界邦的服务宗旨是:更好的服务于出境自助游旅行者,提高亿万国h的旅行质量?/p>


世界邦(北京Q信息技术有限公怺2012q底创立Q集l国内各大著名互联网公司与出境旅游行业精英,创立伊始便得到国际顶U风投注资?br />

世界邦旅行网Qwww.shijiebang.comQ区别于传统旅游论坛与媒体,致力于打通境外服务提供商与旅行者之间的传统壁垒Q搭建帮助千万旅行者实现高性h比、高品质出境自助游的新型旅行C֌和电子商务开攑^収ͼ从而推动出境游领域的业升U。世界邦旅行商城“Travel Mall”Q作一全新概念的旅行服务与商品交易q_Q本w不直接售卖商品Q而是由^C汇集的数癑֮境内外商家提供旅行商品和服务Q世界邦提供交易q_和第三方交易担保Q且提供{证教室、行E设计、甄选比仗随行工L独特服务Q以满旅行者在出境游咨询、规划行E、品选购{各斚w的需求?/p>

此外Q世界邦旅行|还們ֿ打造旅行者与旅行达h、旅行机构、旅行服务提供商之间的互动交^収ͼ共同分n旅行l验、发现旅行精彩!


薪水范围: 向业界看? 无上? 具体面议
  
  
职位4: 高JAVA工程?架构?/strong>
1.  有互联网|站开发经验最?例如Zh, 新浪微博, QzonecM|站) 
2.  有创新能? 有独立思想 
3. 较好的沟通能? 团队协作能力 
4. 非常熟悉互联|网站的开发, 了解整个|站的组l和架构
5. 非常熟悉Java语言中和互联|开发相关的知识
6. 熟悉常用开发框Ӟ 例如Spring Framework或类似框?/div>
7. 熟悉Mysql或类似数据库Q?对NOSQL相关领域有了?/div>
8. 对缓存系lMemcache, redis{有一定的使用l验
9. 有钻研精, Ҏ知的领域有深入探索,学习的激?/div>
10.  快速学习,了解业界最新动态,不断提升自我
11. 热爱旅游, 热爱摄媄优先考虑 
  

  
职位3: 高前端工程?/strong>
•   有大中型交互性网站品经?例如Zh, 新浪微博, QzonecM|站) 
•   有创新能? 有独立思想 
•   较好的沟通能? 团队协作能力 
•   非常熟悉互联|网站的JS开发, 能开发相兛_中型|站的整个前端架?/div>
•   非常熟悉互联|网站的CSS开发,面制作Q?Ҏ览器兼容性有深刻认识
•   Ҏ个网站的前端开发工作有l筹规划的经?/div>
•   热爱旅游, 热爱摄媄优先考虑 
想了解详l信? 可以加我QQ详聊.


Scud(飞云侠) 2012-09-09 21:04 发表评论
]]>The 13 Secrets To Facebook's Success (?http://m.tkk7.com/scud/archive/2012/05/20/378620.htmlScud(飞云侠)Scud(飞云侠)Sun, 20 May 2012 08:28:00 GMThttp://m.tkk7.com/scud/archive/2012/05/20/378620.htmlhttp://m.tkk7.com/scud/comments/378620.htmlhttp://m.tkk7.com/scud/archive/2012/05/20/378620.html#Feedback0http://m.tkk7.com/scud/comments/commentRss/378620.htmlhttp://m.tkk7.com/scud/services/trackbacks/378620.htmlHenry Blodget | May 17, 2012, 11:31 AM 

Read more: http://www.businessinsider.com/secrets-to-facebooks-success-2012-5?op=1#ixzz1vOat0585
 

Eight years ago, Facebook was a coding project in Mark Zuckerberg's dorm room.

Now its a global business with $4 billion of revenue that is used by 1/8th of the world's population. And it's worth more than $100 billion.

When Facebook started, there were dozens of other social networks going after the same opportunity.

Facebook won. They lost.

Here are some reasons why--reasons that apply to almost every business.


1. Move fast. 快速行?推进

1. Move fast.
Mark Zuckerberg built the first version of Facebook in his spare time in his Harvard dorm room.

He didn't write a business plan.

He didn't endlessly ask friends and advisors what they thought of the idea.

He didn't "research the market," apply for patents or trademarks, assemble focus groups, or do any of the other things that entrepreneurs are supposed to do.

He just built a cool product quickly and launched it.

And Facebook was born.

2. Remember that ideas are a dime a dozen--it's all about execution. 有了x, q需要执?/h2>
2. Remember that ideas are a dime a dozen--it's all about execution.
From the moment Facebook was launched, there was a huge fight about whose idea it was.

Two Harvard seniors, the Winklevosses, said it was their idea--that Mark Zuckerberg had "stolen it."

This led to a legal fight that has lasted for nearly a decade.

Meanwhile, outside the clubby world of Harvard, there were dozens of other entrepreneurs who had similar ideas. And lots of them launched those ideas. But, today, there's only one Facebook.

Why?

Because ideas are a dime a dozen.

What matters is making them happen.

As the fictional Mark Zuckerberg told the fictional Winklevoss brothers in the movie: "If you had invented Facebook, you would have invented Facebook."

Don't waste time congratulating yourself for having a good idea. Just go make it happen.

3. Keep it simple (don't overbuild). 保持?不要q度)

3. Keep it simple (don't overbuild).
Many companies get so entranced with all the amazing features they want to build into their products that they make their products so complex that no one can figure out how to use them.

Or they take so long to develop their products that by the time they come out, they have already been leapfrogged.

The first version of the "thefacebook" was very simple. It did one thing well.

Then Zuckerberg and the Facebook team improved it over time. And, each time, they made sure that the service was still easy to use.

(Okay, the privacy controls are ludicrously complex, but no one pays attention to those).

4. Figure out what will kill you... and make sure it doesn't. 扑և哪些是可能的致命? q?/h2>
4. Figure out what will kill you... and make sure it doesn't.
Most people have long since forgotten, but Facebook was far from the first social network.

There were several other college networks in existence before Facebook launched in 2004, including at Columbia and Stanford.

(The latter, called Club Nexus, had been around since 2001. But, in violation of Facebook Success Secret No. 3, it was too complex. So it never really took off.)

Out in the real world, meanwhile, Friendster and MySpace were taking the world by storm.

But then Friendster committed suicide.

How?

By failing to restrict usage until it had the back-end infrastructure in place to support it.

Demand for Friendster became so intense that the service slowed to a crawl. By the time the company finally fixed the back-end, a year later, most of Friendster's U.S. users had defected to other networks.

When Zuckerberg and his co-founders rolled out Facebook, they carefully controlled new registrations. They added one school at a time, waiting until they were certain that their infrastructure could handle it. Thus, Facebook always "worked."

In other words, Zuckerberg correctly identified one of the things that could kill Facebook--and he made certain not to fall prey to it.

5. Make your primary focus the product, not the "business" or "shareholder value." 产品W一, 不是商业, 也不是股东利?/h2>
5. Make your primary focus the product, not the "business" or "shareholder value."

Facebook Roadshow

Mark Zuckerberg was famously uninterested in Facebook's business in the early days. Instead, he focused all of his energy on Facebook's product.

This product obsession went so far that Zuckerberg continually turned away advertising clients, because he didn't want ads to muck up the service. Ads weren't cool. Zuckerberg wanted Facebook to be cool.

As Facebook grew, Zuckerberg retained his focus on the product. He then hired senior executives--Sheryl Sandberg and David Ebersman--to run the company's business and finances.

As Facebook prepared to go public, Zuckerberg wrote a letter to shareholders in which he stated the company's intention to focus on its "social mission" first and its business second.

On Wall Street, not surprisingly, this is heresy. In Wall Street's view, companies are supposed to focus all of their efforts on creating value for their shareholders (translation: making the stock price go up.)

As Amazon and other companies have demonstrated, however, one of the best ways to create huge amounts of shareholder value over the long-term is to focus obsessively on the your product and your customers. If you do that, the business will follow. And you won't make the mistake that a lot of companies make, which is to focus on the business at the expense of the product. Nothing exposes you to the risk of disruption or mediocrity like emphasizing "business" and neglecting the product.

6. Get really really good at hiring... and really really good at firing. 擅长招h, 也擅长开?/h2>
6. Get really really good at hiring... and really really good at firing.

Dylan Love

The strength of a company has nothing to do with its technology or current products. It has to do with its people.

(Why? Because technology and products change. Quickly.)

Even Steve Jobs was quick to admit that no one can do it alone.

So if you want to build a great company, you have to build a great team. And building a great team means two things:

  • Hiring well, and
  • Firing well.

It's easy to understand how to hire well: You have to find the best people for each position and then persuade them to join the company.

Firing well, meanwhile, is critical for two reasons: First, no matter how careful you are, you're going to make hiring mistakes, and you need to fix them quickly. Secondly, if your company is growing rapidly, it will eventually outgrow some of your early executives--and you'll need to replace them. In short, if you don't "fire well," your company will slip into mediocrity.

In Facebook's early days, the company made lots of hiring mistakes, but it addressed them quickly. Facebook was also good at replacing executives as the company outgrew them.

7. Maintain control. 控制?/h2>
7. Maintain control.

Courtesy of Wikipedia

Every company has three main constituencies:

  • Customers
  • Employees
  • Shareholders

The best companies balance the interests of all three of them.

Weaker companies, meanwhile, emphasize the interests of one constituency at the expense of the others. They pay employees too little to make ends meet, for example. Or they try to save on manufacturing costs and produce crappy products. Or they pay their managers so much for mediocre work that they lose their edge.

One of the reasons some companies fall into this trap is that they end up controlled by short-term shareholders who have very different interests than the company's customers and employees.

If Facebook had been controlled by its venture capitalists, it is likely that the company would have sold out long before now. If, as a public company, Facebook were beholden to the short-term needs of public shareholders, it might be tempted to cut research and development costs or take other shortcuts to meet its quarterly numbers.

But Facebook has always been controlled by Mark Zuckerberg. And Zuckerberg has always been more focused on building his long-term vision than on capitalizing on short-term financial rewards.

One way to ensure that your company won't get pulled off course, therefore, is to maintain control of it. If not by owning complete voting control, the way Mark Zuckerberg does, by having key shareholders who support your vision.

8. Don't endlessly "focus group"--just roll out new features and adapt to the screams. 不要止步于目标客? 不停推出新功能ƈ成ؓ焦点 --- 用户不知道他们要什?/h2>
8. Don't endlessly "focus group"--just roll out new features and adapt to the screams.
Steve Jobs also famously said that customers don't know what they want.

It was Apple's job, Jobs continued, to figure out what the customers would want--and then give it to them.

Facebook has always operated the same way.

Instead of "focus-grouping" new features, Facebook has just rolled them out. Sometimes, these new features have been met with outrage and screams. Facebook has then adapted or killed the new features based on what it learns from the screams.

In the case of "News Feed," for example, Facebook kept the feature but tweaked it to address some of its users' concerns. And this feature, which was initially hated, has gone on to become one of Facebook's most important features.

In the case of "Beacon," meanwhile, Facebook ultimately withdrew the feature completely.

Each time Facebook has rolled out a product that was greeted with screams, some observers of the company have concluded that the company "made a mistake." Although in a limited sense, these features might have included "mistakes," the process itself is deliberate. And it works.

9. Cultivate smart advisors and learn everything you can from them.  聚集聪明的顾问ƈ向他们学?/h2>
9. Cultivate smart advisors and learn everything you can from them.
Leadership and management are skills.

As such, they can (and have to be) learned.

As venture capitalist Ben Horowitz puts it, CEOs are made, not born.

Mark Zuckerberg's skill as a CEO, which is now prodigious, was deliberately acquired.

Early in Facebook's development, Zuckerberg was such a lousy leader that one of his executives cornered him to tell him he needed "CEO lessons."

From then on, Zuckerberg dedicated himself to learning as much and as fast as he could.

To help with this, he cultivated a group of advisors, including some of the best entrepreneurs, investors, and executives in the country. This group included Steve Jobs, VC Marc Andreessen, investor Peter Thiel, Jim Breyer of Accel Partners, Warren Buffett, Donald Graham of the Washington Post, and many others. Zuckerberg learned as much as he could from each of these men, as well as from many of the executives he recruited to Facebook. And, gradually, he became a great leader.

No one has all the answers. And the more talented people you surround yourself with, the more likely you'll be to be exposed to some good ones.

10. Grow skin as thick as a pachyderm's. 成功的人受到的非议多, 脸皮要厚?

10. Grow skin as thick as a pachyderm's.

Na Son Nguyen/AP

If you're doing something hard, innovative, or interesting--in short, something worth doing--you're going to get criticized.

The more successful you are, the more this criticism will increase.

You don't have to enjoy the criticism, but you do have to learn to tolerate it. Because there's absolutely nothing you can do to stop it.

People will be jealous. They will be angry. They won't understand. They will have agendas (the media, competitors). They will be frustrated at the way they were treated (ex-employees). They will want money and credit.

In short, they will lob no end of hell-fire your way. And, sometimes, the criticism will be accurate.

Some of the immense amount of criticism directed at Mark Zuckerberg over the years has been accurate. In the beginning, he was a lousy leader. He has made many mistakes. He did do some things (very early on) that were questionable ethically. He pissed a lot of people off.

This criticism had to have hurt.  How could it not?  But Mark Zuckerberg never let it derail his desire to continue to build Facebook. And he never let it get to him to the point where he quit.

No matter what you do in life, if you're successful, people are going to throw rocks at you. If you're going to keep succeeding, you have to grow skin thick enough that they'll just bounce off.

11. If you ever think that you're done--you're done. 如果你觉得你已经搞定? 那你完?/h2>
When Facebook finally blew past the collapsing MySpace a few years ago, it "won" the social-media race.

At that point, it could have settled back and congratulated itself for a job well done.

Fortunately for everyone at the company--and its users and shareholders--it didn't.

Facebook kept running as fast and hard as it could, putting as much distance between itself and its competitors as possible. It kept poaching talent from competitors and would-be competitors. Every time a new startup invented something cool, Facebook copied it. It kept its progress in perspective: Mark Zuckerberg is fond of saying that the company is only 1% done. And so on.

Andy Grove famously said that "only the paranoid survive." In most businesses, that's accurate. If you ever think that you're done, you're done.

12. Ignore Wall Street and other would-be deal-makers (unless you really want to make a deal). 别让那些...来烦?/h2>
12. Ignore Wall Street and other would-be deal-makers (unless you really want to make a deal).
If things are going well, your doors will be knocked down by people who want to meet with you to see how you can "work together" or "learn more about where you're headed."

These potential partners and service-providers will include consultants, bankers, investors, potential acquirers, and competitors. They'll also include any number of other folks who want to sell you things.

Some of these people will be extremely smart, rich, and powerful. They'll talk a great game. And they'll talk your ears off.

Some of the these people may also actually be able to help--doing favors, providing information and suggestions, making introductions, etc.

But what these folks won't do is help you produce a better product or service. And mostly they'll just distract you and waste your time.

If you ever need bankers or other service providers, they won't be hard to find. Pick up the phone, and dozens of highly qualified ones will instantly appear at your door.

The same goes for most other would-be partners and service providers.

There are only 12-16 hours in a day and 365 days in a year. If you let would-be partners and service providers drive your agenda, they'll take all that time and then some. So don't let them. Focus on your product and your customers. Let would-be partners and service providers "learn where you're headed" by watching you.

13. Focus on the long term. xq景

13. Focus on the long term.

Ignore them. It's just noise.

If you read the financial media, you could be forgiven for assuming that success is all about "months" and "quarters."

Every quarter, every public company goes through a ridiculous ritual in which announces that it has either "beaten expectations" or "missed estimates." And its stock then soars or plummets. And the media then trashes or applauds it. And so on.

In case you don't realize it yet, these quarterly rituals are usually staged rituals: Companies issue "guidance" to analysts, publicly or privately. The "guidance" is designed to set expectations so low that even a mediocre quarter will "beat expectations." Investors know this and therefore have "whisper numbers" that represent their real expectations. And that's why stocks often go down even when companies "beat expectations."

Meanwhile, some companies get so focused on "making the quarter" that they begin to warp their sales processes and pricing just to meet this random time hurdle. Customers soon learn that if they wait until the end of the quarter to sign their deal, they'll get a much better deal. And, soon, no one signs anything until the end of the quarter.

So the short-term quarterly game isn't just about wasting time managing investor expectations...it also hurts the business.

The best approach to this whole quarterly game is to minimize it as much as possible. No great companies are built by obsessing about quarters. Great companies are built by focusing on a vision that will create many years or even decades to create. In addition to Facebook, think Walmart, Google, Apple, and Amazon.

Put differently, it's a marathon, not a sprint. And you should obsess about getting to the finish line in the marathon, not about each "beating expectations" with each individual mile-time.



Read more: http://www.businessinsider.com/secrets-to-facebooks-success-2012-5?op=1#ixzz1vOb2ypOD
 


Scud(飞云侠) 2012-05-20 16:28 发表评论
]]>
<门后的秘?gt; dҎ摘录http://m.tkk7.com/scud/archive/2012/04/24/376508.htmlScud(飞云侠)Scud(飞云侠)Tue, 24 Apr 2012 12:33:00 GMThttp://m.tkk7.com/scud/archive/2012/04/24/376508.htmlhttp://m.tkk7.com/scud/comments/376508.htmlhttp://m.tkk7.com/scud/archive/2012/04/24/376508.html#Feedback0http://m.tkk7.com/scud/comments/commentRss/376508.htmlhttp://m.tkk7.com/scud/services/trackbacks/376508.html
熟悉团队:
    了解每一个成员的情况, 需?br />    面谈了解别h的情? 态度, 问题
    定期一对一面谈, 更新状况
    
团队工作情况
    了解所有进行的目
    每周都列出工作内?br />    明确团队工作的目?br />    d的优先和重要?br />    可视化工作内?br />    目l合理
    不要l员工同时分配多Q?br />
工作相关
    提供合适的工作环境
    U极听取反馈, 作出调整
    l成员及时的反馈, 让其了解
    新员工如何快速融入团?br />    不要吝啬你的赞扬

技术发?(自己补充?
    ? 清晰
    提供l一的基框架q积极改q?br />    提供推荐的标准开发流E?br />    

个h发展
    为每个h制定个h目标
    为成员提供指?br />    帮助别h
    站在别h的立?br />    培训, 指导
    不要ȝ员工的发?br />
解决问题
    攉实际情况, 全面了解, 不要责备
    问题的优先如何军_?
    提出3U解x案以讨论
    利用团队力量L解决Ҏ
    制定实际的执行计? 执行?br />
分配工作
    学会分配, 不要凡事w亲
    {略性工作可以分z?br />    信赖他h, l果导向?

自我理
    控制情A
    U极学习

理外部变化
    控制外部变化, 不折?br />    了解变化的底层原?br />    dq接变化, 而不是被动接?br />        
团队
    zd
    招聘
    内部培训, 分n
    技术专?
    外部口碑?


Scud(飞云侠) 2012-04-24 20:33 发表评论
]]>已经使用ant的项目如何利用maven来管理依?/title><link>http://m.tkk7.com/scud/archive/2010/11/06/337399.html</link><dc:creator>Scud(飞云侠)</dc:creator><author>Scud(飞云侠)</author><pubDate>Sat, 06 Nov 2010 03:50:00 GMT</pubDate><guid>http://m.tkk7.com/scud/archive/2010/11/06/337399.html</guid><wfw:comment>http://m.tkk7.com/scud/comments/337399.html</wfw:comment><comments>http://m.tkk7.com/scud/archive/2010/11/06/337399.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.tkk7.com/scud/comments/commentRss/337399.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/scud/services/trackbacks/337399.html</trackback:ping><description><![CDATA[<br /> <br /> maven对于理大型目来说是不错的东西, 当然也可以仅用它来做依赖理 (cM的有IVY), 不过我们有一些项目已l用了ant来构? 那么如何能二者兼? 对ant的build.xml做小的改动可以同时支持用maven来做依赖理, 也可以用ant来做构徏. --- 当然单的构徏其实不需要ant, maven完全可以胜Q.<br /> <br /> <br /> <strong>Maven的一些特?/strong><br /> <ul> <li>  可以方便q行依赖理</li> <li>  提供了标准的目录l构, 保证大家l一. (也可以覆盖默认设|?</li> <li>  利用profile解决试, 生环境的配|问?/li> <li>  提供了标准的构徏d, 不需要自己写</li> <li>  多个目可以集中理, 可以树状l构理, 一目了? 可以快速徏立v开发环? 基本上几步就可以~译目? 相反手动方式? 每个目都要配置依赖p累死?</li> <li>  ZU定的方? 对于Ҏ情况处理h有一些麻? 一些情况下ant更灵zL?</li> </ul> <br /> <br /> <br /> <strong>我们的目?/strong><br /> <br /> 1. 对喜Ƣmaven的h, 能快速利用maven创徏新的目, 而不用痛苦地M个一个找依赖, 作ؓ普通开发者可以不兛_复杂的build.xml, 或者直接用maven构徏<br /> 2. 对原本用ant脚本的项? 在要求兼容maven的情况下, 仅仅dmaven的依赖管? 同时可以为ant提供依赖包的自动攉, 不需要手动自己找.<br /> 3. 推行maven的? 快速创建开发环? <br /> 4. subversion不在保存一堆一堆巨大的jar?br /> <br /> <br /> 本文的内容主要是针对上面的第二条, 当然最l是希望推行maven, 方便理.<br /> <br /> 首先我们要安装好ant, maven2, 配置好环境变? 修改maven的缓存\? <br /> <br /> 然后安装 http://maven.apache.org/ant-tasks/index.html ? 可以直接攑֜ant的lib目录? 当然q有其他方式, 例如在build.xml里指定\?<br /> <br /> <br /> <strong>准备pom.xml</strong>, 针对本文所说情? 只需要写基本信息和依赖包配置卛_.<br /> <br /> 举例:<br /> <br /> <br /> <br /> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000ff;"><?</span><span style="color: #ff00ff;">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000ff;">?></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">project </span><span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">="http://maven.apache.org/POM/4.0.0"</span><span style="color: #ff0000;"><br />          xmlns:xsi</span><span style="color: #0000ff;">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #ff0000;"><br />          xsi:schemaLocation</span><span style="color: #0000ff;">="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">modelVersion</span><span style="color: #0000ff;">></span><span style="color: #000000;">4.0.0</span><span style="color: #0000ff;"></</span><span style="color: #800000;">modelVersion</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;">com.test</span><span style="color: #0000ff;"></</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;">maventest</span><span style="color: #0000ff;"></</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">name</span><span style="color: #0000ff;">></span><span style="color: #000000;">Maven Test</span><span style="color: #0000ff;"></</span><span style="color: #800000;">name</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">version</span><span style="color: #0000ff;">></span><span style="color: #000000;">1.0</span><span style="color: #0000ff;"></</span><span style="color: #800000;">version</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">build</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">plugins</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">plugin</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />                 </span><span style="color: #0000ff;"><</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;">org.apache.maven.plugins</span><span style="color: #0000ff;"></</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />                 </span><span style="color: #0000ff;"><</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;">maven-compiler-plugin</span><span style="color: #0000ff;"></</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />                 </span><span style="color: #0000ff;"><</span><span style="color: #800000;">configuration</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />                     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">source</span><span style="color: #0000ff;">></span><span style="color: #000000;">1.6</span><span style="color: #0000ff;"></</span><span style="color: #800000;">source</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />                     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">target</span><span style="color: #0000ff;">></span><span style="color: #000000;">1.6</span><span style="color: #0000ff;"></</span><span style="color: #800000;">target</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />                 </span><span style="color: #0000ff;"></</span><span style="color: #800000;">configuration</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"></</span><span style="color: #800000;">plugin</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"></</span><span style="color: #800000;">plugins</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"></</span><span style="color: #800000;">build</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">dependencies</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;">org.jgroups</span><span style="color: #0000ff;"></</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;">jgroups</span><span style="color: #0000ff;"></</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">version</span><span style="color: #0000ff;">></span><span style="color: #000000;">2.10.0.GA</span><span style="color: #0000ff;"></</span><span style="color: #800000;">version</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"></</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;">commons-lang</span><span style="color: #0000ff;"></</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;">commons-lang</span><span style="color: #0000ff;"></</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">version</span><span style="color: #0000ff;">></span><span style="color: #000000;">2.5</span><span style="color: #0000ff;"></</span><span style="color: #800000;">version</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"></</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />           </span><span style="color: #0000ff;"><</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;">junit</span><span style="color: #0000ff;"></</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />           </span><span style="color: #0000ff;"><</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;">junit</span><span style="color: #0000ff;"></</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />           </span><span style="color: #0000ff;"><</span><span style="color: #800000;">version</span><span style="color: #0000ff;">></span><span style="color: #000000;">3.8.1</span><span style="color: #0000ff;"></</span><span style="color: #800000;">version</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />           </span><span style="color: #0000ff;"><</span><span style="color: #800000;">scope</span><span style="color: #0000ff;">></span><span style="color: #000000;">test</span><span style="color: #0000ff;"></</span><span style="color: #800000;">scope</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"></</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"></</span><span style="color: #800000;">dependencies</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">project</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span></div> <br /> <br /> 如果有本C? q可以配|repository. (推荐优先使用本地服务?, q个文g内容很少, 主要是依赖包的信? 也是我们最x的信?<br /> <br /> <br /> 下面我们来修Ҏ们的build.xml, 为ant提供依赖服务:<br /> <br /> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">project </span><span style="color: #ff0000;">name</span><span style="color: #0000ff;">="jgroups"</span><span style="color: #ff0000;"> basedir</span><span style="color: #0000ff;">="."</span><span style="color: #ff0000;"> xmlns:artifact </span><span style="color: #0000ff;">="urn:maven-artifact-ant"</span><span style="color: #ff0000;"> </span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #008000;"><!--</span><span style="color: #008000;"> 存放依赖包的目录 </span><span style="color: #008000;">--></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">property </span><span style="color: #ff0000;">name</span><span style="color: #0000ff;">="build.lib.dir"</span><span style="color: #ff0000;"> location</span><span style="color: #0000ff;">="./lib"</span><span style="color: #ff0000;"> </span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #008000;"><!--</span><span style="color: #008000;"> find maven-ant-tasks, you can use classpathref to specify the jar, or just copy the jar to ant/lib  </span><span style="color: #008000;">--></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">typedef  </span><span style="color: #ff0000;">resource </span><span style="color: #0000ff;">="org/apache/maven/artifact/ant/antlib.xml"</span><span style="color: #ff0000;">  uri</span><span style="color: #0000ff;">="urn:maven-artifact-ant"</span><span style="color: #ff0000;">  </span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #008000;"><!--</span><span style="color: #008000;"> maven的文?nbsp;</span><span style="color: #008000;">--></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">artifact:pom  </span><span style="color: #ff0000;">id </span><span style="color: #0000ff;">="maven.project"</span><span style="color: #ff0000;">  file </span><span style="color: #0000ff;">="pom.xml"</span><span style="color: #ff0000;">   </span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">artifact:dependencies </span><span style="color: #ff0000;">filesetId</span><span style="color: #0000ff;">="deps.fileset.compile"</span><span style="color: #ff0000;"> useScope</span><span style="color: #0000ff;">="compile"</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #008000;"><!--</span><span style="color: #008000;"><pom file="pom.xml"/></span><span style="color: #008000;">--></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">pom </span><span style="color: #ff0000;">refid</span><span style="color: #0000ff;">="maven.project"</span><span style="color: #ff0000;">  </span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"></</span><span style="color: #800000;">artifact:dependencies</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">artifact:dependencies </span><span style="color: #ff0000;">filesetId</span><span style="color: #0000ff;">="deps.fileset.test"</span><span style="color: #ff0000;"> scopes</span><span style="color: #0000ff;">="test"</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">pom </span><span style="color: #ff0000;">refid</span><span style="color: #0000ff;">="maven.project"</span><span style="color: #ff0000;">  </span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"></</span><span style="color: #800000;">artifact:dependencies</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">artifact:dependencies </span><span style="color: #ff0000;">filesetId</span><span style="color: #0000ff;">="deps.fileset.provide"</span><span style="color: #ff0000;"> scopes</span><span style="color: #0000ff;">="provide"</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">pom </span><span style="color: #ff0000;">refid</span><span style="color: #0000ff;">="maven.project"</span><span style="color: #ff0000;">  </span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"></</span><span style="color: #800000;">artifact:dependencies</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br />     </span><span style="color: #0000ff;"><</span><span style="color: #800000;">target </span><span style="color: #ff0000;">name</span><span style="color: #0000ff;">="lib.init"</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">copy </span><span style="color: #ff0000;">todir</span><span style="color: #0000ff;">="${build.lib.dir}/compile"</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">fileset </span><span style="color: #ff0000;">refid</span><span style="color: #0000ff;">="deps.fileset.compile"</span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">mapper </span><span style="color: #ff0000;">type</span><span style="color: #0000ff;">="flatten"</span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"></</span><span style="color: #800000;">copy</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">copy </span><span style="color: #ff0000;">todir</span><span style="color: #0000ff;">="${build.lib.dir}/test"</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">fileset </span><span style="color: #ff0000;">refid</span><span style="color: #0000ff;">="deps.fileset.test"</span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">mapper </span><span style="color: #ff0000;">type</span><span style="color: #0000ff;">="flatten"</span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"></</span><span style="color: #800000;">copy</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"><</span><span style="color: #800000;">copy </span><span style="color: #ff0000;">todir</span><span style="color: #0000ff;">="${build.lib.dir}/provide"</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">fileset </span><span style="color: #ff0000;">refid</span><span style="color: #0000ff;">="deps.fileset.test"</span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br />             </span><span style="color: #0000ff;"><</span><span style="color: #800000;">mapper </span><span style="color: #ff0000;">type</span><span style="color: #0000ff;">="flatten"</span><span style="color: #0000ff;">/></span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;"></</span><span style="color: #800000;">copy</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;"></</span><span style="color: #800000;">target</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br /> <br />     </span><span style="color: #008000;"><!--</span><span style="color: #008000;"> <img src="http://m.tkk7.com/Images/dot.gif" alt="" /><img src="http://m.tkk7.com/Images/dot.gif" alt="" />..其他<img src="http://m.tkk7.com/Images/dot.gif" alt="" /><img src="http://m.tkk7.com/Images/dot.gif" alt="" /><img src="http://m.tkk7.com/Images/dot.gif" alt="" />..     </span><span style="color: #008000;">--></span><span style="color: #000000;"><br /> <br /> <br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">project</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span></div> <br /> <br /> <br /> 主要增加了一个target, 是把maven中定义的依赖包复制到指定目录? 而不需要自己准备或者从subversion下蝲.<br /> <br /> (ant的其他target也可使用定义的几个变量作为classpath)<br /> <br /> 一般依赖分三种, h意区? 否则把servlet{jar包发布到服务? 一般会出错:<br /> <ul> <li>  compile: ~译, 用于q行时和~译? 打包发布要包?/li> <li>  provide: 容器提供的类, 主要用于~译, 打包发布时不包含, 例如servlet-api</li> <li>  test: 仅用于编译和q行试用例, 打包时不包含.</li> </ul> <br /> <br /> <br /> <strong>使用Ҏ</strong>:<br /> <ul> <li>  checkout目</li> <li>  使用ide的方式导入maven目. 如果需要手? q行ant lib.init   (如果下蝲jar时包出错, 注意查groupId, artifactId和版本号.)</li> <li>  手动创徏目, 指定library, ׃需要一个一个找? (如果导入maven目的方? 则一切自动会配置?</li> </ul> <br /> <br /> <br /> <br /> <br /> <strong>参考网?/strong>: <br /> http://book.51cto.com/art/201001/177845.htm<br /> http://skydream.javaeye.com/blog/437938<br /> http://maven.apache.org/ant-tasks/examples/dependencies.html<br /> <br /> <br /> <br /> <img src ="http://m.tkk7.com/scud/aggbug/337399.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/scud/" target="_blank">Scud(飞云侠)</a> 2010-11-06 11:50 <a href="http://m.tkk7.com/scud/archive/2010/11/06/337399.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MAVEN:如何为开发和生环境建立不同的配|文?--我的z方?/title><link>http://m.tkk7.com/scud/archive/2010/10/27/336326.html</link><dc:creator>Scud(飞云侠)</dc:creator><author>Scud(飞云侠)</author><pubDate>Wed, 27 Oct 2010 14:31:00 GMT</pubDate><guid>http://m.tkk7.com/scud/archive/2010/10/27/336326.html</guid><wfw:comment>http://m.tkk7.com/scud/comments/336326.html</wfw:comment><comments>http://m.tkk7.com/scud/archive/2010/10/27/336326.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://m.tkk7.com/scud/comments/commentRss/336326.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/scud/services/trackbacks/336326.html</trackback:ping><description><![CDATA[     摘要: 其实也是最q才看Maven, 以前都是用ant+ivy, 对于轻量U的目来说_? 而且非常灉|. 看了看Maven, U定.... 现在~程都说U定, U定是挺? 问题是超出约定的事情太多? 到头来还要依赖其他东? 真不想用maven? 以前我们开发环境和生环境的配|文仉是单独分开目录存放? ant脚本搞个变量p动打包不同的文g? 我觉得管理v来也很容? 所?..  <a href='http://m.tkk7.com/scud/archive/2010/10/27/336326.html'>阅读全文</a><img src ="http://m.tkk7.com/scud/aggbug/336326.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/scud/" target="_blank">Scud(飞云侠)</a> 2010-10-27 22:31 <a href="http://m.tkk7.com/scud/archive/2010/10/27/336326.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用ZooKeeper为CXF或其他服务动态更新服务器信息http://m.tkk7.com/scud/archive/2010/10/16/335301.htmlScud(飞云侠)Scud(飞云侠)Sat, 16 Oct 2010 11:37:00 GMThttp://m.tkk7.com/scud/archive/2010/10/16/335301.htmlhttp://m.tkk7.com/scud/comments/335301.htmlhttp://m.tkk7.com/scud/archive/2010/10/16/335301.html#Feedback1http://m.tkk7.com/scud/comments/commentRss/335301.htmlhttp://m.tkk7.com/scud/services/trackbacks/335301.html
  阅读全文

Scud(飞云侠) 2010-10-16 19:37 发表评论
]]>
扩展CXF, 支持LoadBalance负蝲均衡http://m.tkk7.com/scud/archive/2010/10/15/335224.htmlScud(飞云侠)Scud(飞云侠)Fri, 15 Oct 2010 05:01:00 GMThttp://m.tkk7.com/scud/archive/2010/10/15/335224.htmlhttp://m.tkk7.com/scud/comments/335224.htmlhttp://m.tkk7.com/scud/archive/2010/10/15/335224.html#Feedback0http://m.tkk7.com/scud/comments/commentRss/335224.htmlhttp://m.tkk7.com/scud/services/trackbacks/335224.html

CXF是一个比较流行的Web Service框架. ( 当然如果q求更高? q可以去搜烦ice, thrift, protobuff之类?

q一个月, 断断l箋地又好好看了看CXF的一些代? CXF的文档还是很Ơ缺,特别是关于内部实现的东西. 从我的感觉来? 内部实现q是挺复杂的. Inteceptor, Feature, ConduitSelector q些概念一大堆, 又差不多可以做类似的事情, 真是让h头晕.


CXF本n提供了一个FailoverFeature, 可以在调用服务出错时切换到其他服务器, 但是无法做到负蝲均衡, 我研I了几天, 在FailoverFeature的基上改出来一个LoadBalanceFeature, 当然也同时支持Failover.

首先我们来看看如何用CXF的FailoverFeature: (下蝲CZ中包括用xml和代码两U方? 当然CXF自己q提供了使用wsdl内部定义的方?

    我们需要先准备一个HelloService, 非常单的一个Web Service, q里不在贴出, 具体可以看下载包
    调用代码CZ:

package org.javascud.extensions.cxf.testfailover;

import org.apache.cxf.clustering.FailoverFeature;
import org.apache.cxf.clustering.RandomStrategy;
import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.javascud.extensions.cxf.service.Hello;

import java.util.ArrayList;
import java.util.List;

public class HelloServiceFailOverClient
{
    
public static void main(String[] args)
    {
        String helloFirst 
= "http://localhost:8080/service/Hello";
        String helloSecond 
= "http://localhost:8081/service/Hello";
        String helloThird 
= "http://localhost:8082/service/Hello";
        String helloFour 
= "http://localhost:8083/service/Hello";

        List
<String> serviceList = new ArrayList<String>();
        serviceList.add(helloFirst);
        serviceList.add(helloSecond);
        serviceList.add(helloThird);
        
//serviceList.add(helloFour);

        RandomStrategy strategy 
= new RandomStrategy();
        strategy.setAlternateAddresses(serviceList);

        FailoverFeature ff 
= new FailoverFeature();
        ff.setStrategy(strategy);

        JaxWsProxyFactoryBean factory 
= new JaxWsProxyFactoryBean();

        List
<AbstractFeature> features = new ArrayList<AbstractFeature>();
        features.add(ff);

        factory.setFeatures(features);
        factory.initFeatures();

        factory.setServiceClass(Hello.
class);
        
//factory.setAddress("http://localhost:8080/service/Hello");

        Hello client 
= (Hello) factory.create();
        String result 
= client.sayHello("felix");
        System.out.println(
"result is: " + result);
    }
}


在遇到错误时可以自动使用下一个服务器, 但是必须要自p|一个地址, 如果不设|的话也可以, 但是会出错然后failover.


下面我们自己来看看我们的 LoadBalanceFeature

1. 首先我们创徏一个LoadBalanceFeature (完全和FailoverFeature一?

   Feature是用来定制Server, Client, Bus的一个组? 具体可以查看AbstractFeature, 我们使用initializeҎ来定制Client, 修改Client的Conduit选择器达到负载均衡的目的.

   LoadBalanceFeature代码如下:

/**
 * This feature may be applied to a Client so as to enable
 * load balance , use any compatible endpoint for the target service.
 *
 * 
@author Felix Zhang   Date:2010-10-3 22:58
 * 
@see org.apache.cxf.clustering.FailoverFeature
 
*/
public class LoadBalanceFeature extends AbstractFeature {
    
private LoadBalanceStrategy loadBalanceStrategy;

    @Override
    
public void initialize(Client client, Bus bus) {
        LoadBalanceTargetSelector selector 
= new LoadBalanceTargetSelector();
        selector.setEndpoint(client.getEndpoint());
        selector.setStrategy(getStrategy());
        client.setConduitSelector(selector);
    }

    
public void setStrategy(LoadBalanceStrategy strategy) {
        loadBalanceStrategy 
= strategy;
    }

    
public LoadBalanceStrategy getStrategy() {
        
return loadBalanceStrategy;
    }

}




2. 定制一个LoadBalanceStrategy 负蝲均衡{略
负蝲均衡{略有很多种, 例如随机选择, 序选择{? FailoverFeature提供了三U策? M很简? 我们在这里就先实现随机策? 其他的策略都很简? 几行代码可以实C.

    q个cM要用来设|?获取所有的提供服务的地址列表, Z方便控制, 我新增了2个选项:
    A: alwaysChangeEndpoint 是否每次h都切换地址: 如果只有一个客L, 可以分担负蝲. ~省为true
    B: removeFailedEndpoint 是否从全局的地址列表中移除失败服务地址 -- 如果你没有监服务器状态的E序

   关于动态增删服务地址
  • 可以使用zookeeper{服务实时监服务器状? 或者自己写E序实现, 调用strategy.setAlternateAddresses卛_.
  • removeFailedEndpoint 如果讄为true, 但没有监服务器状态的E序, 新增的或者复zȝ服务器则无法被恢复到地址列表?
  • 考虑到效率和支持failover, 讄地址列表, U除地址{没有同步锁.
  • 自动U除p|服务地址? 目前仅支持手动地址列表, 没有考虑wsdl中的多服务地址.
  • 后箋我会写一个用zookeeper增删服务地址列表的示? (最q也在看zookeeper)


   主要的代码都在AbstractLoadBalanceStrategy ? 基本?AbstractStaticFailoverStrategy 一? d了一个removeAlternateAddress 用于U除p|的服务地址.

    LoadBalanceStrategy 接口的代码如?

/**
 * Supports pluggable strategies for alternate endpoint selection on
 * load balance.
 * <p/>
 * Random, Retries, Mod (later)
 * <p/>
 * 1. support load balance  2.support fail over.
 *
 * 
@author Felix Zhang   Date:2010-10-1 18:14
 * 
@see org.apache.cxf.clustering.FailoverStrategy
 
*/
public interface LoadBalanceStrategy {

    
/**
     * Get the alternate endpoints for this invocation.
     *
     * 
@param exchange the current Exchange
     * 
@return a failover endpoint if one is available
     
*/
    List
<Endpoint> getAlternateEndpoints(Exchange exchange);

    
/**
     * Select one of the alternate endpoints for a retried invocation.
     *
     * 
@param alternates List of alternate endpoints if available
     * 
@return the selected endpoint
     
*/
    Endpoint selectAlternateEndpoint(List
<Endpoint> alternates);

    
/**
     * Get the alternate addresses for this invocation.
     * These addresses over-ride any addresses specified in the WSDL.
     *
     * 
@param exchange the current Exchange
     * 
@return a failover endpoint if one is available
     
*/
    List
<String> getAlternateAddresses(Exchange exchange);

    
/**
     * Select one of the alternate addresses for a retried invocation.
     *
     * 
@param addresses List of alternate addresses if available
     * 
@return the selected address
     
*/
    String selectAlternateAddress(List
<String> addresses);

    
/**
     * should remove failed endpoint or not.
     * only work for user defined addresses list.
     * 
@return true or false
     
*/
    
boolean isRemoveFailedEndpoint();

    
/**
     * change endpoint every time or not.
     * 
@return boolean
     
*/
    
boolean isAlwaysChangeEndpoint();

    
/**
     * remove failed address from list.
     * 
@param address the failed address
     
*/
    
void removeAlternateAddress(String address);
}



    RandomLoadBalanceStrategyl承?AbstractLoadBalanceStrategy, ?RandomStrategy的区别就是获取下一个服务地址时ƈ不从列表中移除此地址, 否则做不到负蝲均衡?


3. 最重要?LoadBalanceTargetSelector
    A: q个cL较复? 我们Z实现负蝲均衡, 修改?strong>prepare
来动态设|调用的endpoint, 替换{略取决于LoadBalanceStrategy
    主要代码如下:

            boolean existsEndpoint = false;
            
//check current endpoint is not null
            Endpoint theEndpoint = exchange.get(Endpoint.class);
            
if (theEndpoint.getEndpointInfo().getAddress() != null) {
                existsEndpoint 
= true;
            }

            Endpoint nextEndpoint;
            
if (getStrategy().isAlwaysChangeEndpoint() || !existsEndpoint) {
                
//get a endpoint and set to current endpoint
                Endpoint loadBalanceTarget = getLoadBalanceTarget(exchange);
                
if (loadBalanceTarget != null) {
                    logger.info(
"switch to next target: " + loadBalanceTarget.getEndpointInfo().getAddress());
                    setEndpoint(loadBalanceTarget);

                    
//update exchange.org.apache.cxf.message.Message.ENDPOINT_ADDRESS --- 不设|这个就用上ơ的奇?/span>
                    message.put(Message.ENDPOINT_ADDRESS, loadBalanceTarget.getEndpointInfo().getAddress());
                }

                nextEndpoint 
= loadBalanceTarget;
            } 
else {
                
//use current endpoint
                nextEndpoint = theEndpoint;
            }




   
    B:Z和原有FailoverҎ兼? 我们修改?getFailoverTarget函数, 在此函数中要U除p|的服务地址, 因ؓ在之前我们修改了LoadBalanceStrategy, 它在获取地址时不再移除当前地址, 所以我们需要手动移?

    部分代码如下:   
            String currentAddress = getEndpoint().getEndpointInfo().getAddress();

            
//failover should remove current endpoint first, then get next -- Ҏ定义的策略来军_是否从全局地址列表中移?/span>
            if (getStrategy().isRemoveFailedEndpoint()) {
                logger.warn(
"remove current failed address: " + currentAddress);
                
//remove for client, not for current invocation -- 没有同步?/span>
                getStrategy().removeAlternateAddress(currentAddress);
            }

            
//remove for current invocation: 当前h中LU除p|服务地址
            alternateAddresses.remove(currentAddress);

            String alternateAddress 
=
                    getStrategy().selectAlternateAddress(alternateAddresses);





4. 调用实例:

   此处我们采用XML定义方式:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws
="http://cxf.apache.org/jaxws"
       xmlns:clustering
="http://cxf.apache.org/clustering"
       xmlns:util
="http://www.springframework.org/schema/util"
       xsi:schemaLocation
="
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
>

    
<util:list id="addressList">
        
<value>http://localhost:8081/service/Hello</value>
        
<value>http://localhost:8082/service/Hello</value>
        
<value>http://localhost:8083/service/Hello</value>
        
<value>http://localhost:8086/service/Hello</value>
        
<value>http://localhost:8087/service/Hello</value>
        
<value>http://localhost:8088/service/Hello</value>
    
</util:list>

    
<bean id="SequentialAddresses" class="org.apache.cxf.clustering.SequentialStrategy">
        
<property name="alternateAddresses">
            
<ref bean="addressList"/>
        
</property>
    
</bean>

    
<bean id="randomAddresses" class="org.javascud.extensions.cxf.RandomLoadBalanceStrategy">
        
<property name="alternateAddresses">
            
<ref bean="addressList"/>
        
</property>
        
<property name="removeFailedEndpoint" value="true" />
    
</bean>

    
<bean id="loadBalanceFeature" class="org.javascud.extensions.cxf.LoadBalanceFeature">
        
<property name="strategy" ref="randomAddresses" />
    
</bean>


    
<jaxws:client name="helloClient"
                  serviceClass
="org.javascud.extensions.cxf.service.Hello"            >
        
<jaxws:features>
            
<ref bean="loadBalanceFeature" />
        
</jaxws:features>
    
</jaxws:client>


</beans>
 
8081, 8082, 8083是实际存在的服务, 其他的不存在.


调用的Java代码:

package org.javascud.extensions.cxf.loadbalance;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.javascud.extensions.cxf.LoadBalanceStrategy;
import org.javascud.extensions.cxf.service.Hello;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class HelloLoadBalanceAndFailOverClientByXML
{
    
public static void main(String[] args)
    {
        ClassPathXmlApplicationContext context
                
= new ClassPathXmlApplicationContext(new String[]
                {
"org/javascud/extensions/cxf/loadbalance/loadbalance_fail.xml"});
        Hello client 
= (Hello) context.getBean("helloClient");

        LoadBalanceStrategy strategy 
= (LoadBalanceStrategy) context.getBean("randomAddresses");

        Client myclient 
= ClientProxy.getClient(client);
        String address 
= myclient.getEndpoint().getEndpointInfo().getAddress();

        System.out.println(address);

        
for(int i=1; i<=20; i++)
        {
            String result1 
= client.sayHello("Felix" +i);
            System.out.println(
"Call " + i +"" + result1);

            
int left = strategy.getAlternateAddresses(null).size();
            System.out.println(
"================== left " + left + " ===========================");
        }


    }
}

    此处仅仅为模拟测?


5. 关于试用例
    没想好如何写单元试, test里面目前都是随意试的代? 基本照顾到所有功?

    

6. 下蝲
代码下蝲: http://cnscud.googlecode.com/files/extensions-cxf_20101015.zip
源码位置: http://cnscud.googlecode.com/svn/trunk/extensions/  其中cxf目录是此文章相关的源?

7. 有Q何问题请留言.


转蝲h明作者和出处 http://scud.blogjava.net





Scud(飞云侠) 2010-10-15 13:01 发表评论
]]>SQL: 选择?0条记? 不用limit, top....有什么方法哪?http://m.tkk7.com/scud/archive/2010/09/09/331486.htmlScud(飞云侠)Scud(飞云侠)Thu, 09 Sep 2010 03:33:00 GMThttp://m.tkk7.com/scud/archive/2010/09/09/331486.htmlhttp://m.tkk7.com/scud/comments/331486.htmlhttp://m.tkk7.com/scud/archive/2010/09/09/331486.html#Feedback0http://m.tkk7.com/scud/comments/commentRss/331486.htmlhttp://m.tkk7.com/scud/services/trackbacks/331486.html

Scud(飞云侠) 2010-09-09 11:33 发表评论
]]>
监测localhost 本地服务的网l工?socketsniffhttp://m.tkk7.com/scud/archive/2010/09/05/331102.htmlScud(飞云侠)Scud(飞云侠)Sun, 05 Sep 2010 14:30:00 GMThttp://m.tkk7.com/scud/archive/2010/09/05/331102.htmlhttp://m.tkk7.com/scud/comments/331102.htmlhttp://m.tkk7.com/scud/archive/2010/09/05/331102.html#Feedback0http://m.tkk7.com/scud/comments/commentRss/331102.htmlhttp://m.tkk7.com/scud/services/trackbacks/331102.html
1. 查了半天, l于发现 socketsniff可以, 不过也有~点, 是只能一个进E? 不过大部分情况下也够?


2. 当然如果用本C理的方式也可以检? 不过需要修改调用程? 比较ȝ. (Fiddle, Charles{?

3. 商业产品, 例如 commView, 不过查看方式不太?.....可以试用30?




Scud(飞云侠) 2010-09-05 22:30 发表评论
]]>
天顶的彩?/title><link>http://m.tkk7.com/scud/archive/2010/08/27/330085.html</link><dc:creator>Scud(飞云侠)</dc:creator><author>Scud(飞云侠)</author><pubDate>Fri, 27 Aug 2010 10:28:00 GMT</pubDate><guid>http://m.tkk7.com/scud/archive/2010/08/27/330085.html</guid><wfw:comment>http://m.tkk7.com/scud/comments/330085.html</wfw:comment><comments>http://m.tkk7.com/scud/archive/2010/08/27/330085.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/scud/comments/commentRss/330085.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/scud/services/trackbacks/330085.html</trackback:ping><description><![CDATA[<img src="/CuteSoft_Client/CuteEditor/images/emsmiled.gif" align="absmiddle" border="0" alt="" /><br /> <br /> <img alt="" src="http://m.tkk7.com/images/blogjava_net/scud/rainbow/DSC_3229.JPG" height="600" width="437" /><br /> <br /> 2. <br /> <img alt="" src="http://m.tkk7.com/images/blogjava_net/scud/rainbow/DSC_3233.JPG" height="600" width="399" /><br /> <br /> 3. <br /> <br /> <img alt="" src="http://m.tkk7.com/images/blogjava_net/scud/rainbow/DSC_3239.JPG" height="399" width="600" /><br /> <br /> 呵呵 bless<br /> <img src ="http://m.tkk7.com/scud/aggbug/330085.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/scud/" target="_blank">Scud(飞云侠)</a> 2010-08-27 18:28 <a href="http://m.tkk7.com/scud/archive/2010/08/27/330085.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> վ֩ģ壺 <a href="http://imfever.com" target="_blank">ƷŮþþ </a>| <a href="http://gedebai.com" target="_blank">߹ۿ˳Ƶڵ</a>| <a href="http://wwwzs88.com" target="_blank">ɫվѹۿ</a>| <a href="http://jmzc888.com" target="_blank">һѲƵƬ</a>| <a href="http://0551dfcy.com" target="_blank">aɫëƬѲƵ</a>| <a href="http://yuntuzy.com" target="_blank">ˬִ̼߳Ƶ </a>| <a href="http://www12kvkv.com" target="_blank">þWWW˳ɡƬ</a>| <a href="http://miyatb.com" target="_blank">þѾƵ</a>| <a href="http://276194.com" target="_blank">ŷ޾ƷƵ߹ۿ </a>| <a href="http://508009.com" target="_blank">޹Ʒa߹ۿ</a>| <a href="http://pjappuiehjdkhsjkssd2.com" target="_blank">þŷƷ</a>| <a href="http://xj47777.com" target="_blank">þþþŮʦһ</a>| <a href="http://930mk.com" target="_blank">þþƷëƬѹۿ</a>| <a href="http://8xjr.com" target="_blank">ҹڵ</a>| <a href="http://jaubus.com" target="_blank">޹˳Ļһ</a>| <a href="http://mogo321.com" target="_blank">˾Ʒձ</a>| <a href="http://taiyu18.com" target="_blank">Ļ </a>| <a href="http://pite2.com" target="_blank">AVһ</a>| <a href="http://xuanzhicity.com" target="_blank">Ļavר</a>| <a href="http://bixnu.com" target="_blank">պƵ</a>| <a href="http://www99383.com" target="_blank">AV˳ۺ</a>| <a href="http://jiujiujingpin.com" target="_blank">Ƶվ</a>| <a href="http://786087.com" target="_blank">þŷƷ</a>| <a href="http://lyjhjx.com" target="_blank">۲Ƶwwwѹۿ</a>| <a href="http://4p5e.com" target="_blank">ˬƵ</a>| <a href="http://wenbye.com" target="_blank">ҹҹAһ</a>| <a href="http://xxx2222.com" target="_blank">þþƷҹɫAVվ</a>| <a href="http://gnebs.com" target="_blank">ۺ߹ۿ</a>| <a href="http://xxx2222.com" target="_blank">þþþþþþþѾƷ</a>| <a href="http://htsp777.com" target="_blank">߹ۿվ </a>| <a href="http://8833081.com" target="_blank">ĻëƬѿ</a>| <a href="http://wuaiav.com" target="_blank">Ƶվ߹ۿ</a>| <a href="http://ss8kk.com" target="_blank">һëƬѹۿ</a>| <a href="http://918989b.com" target="_blank">19ѹۿ</a>| <a href="http://kingrel.com" target="_blank">һۿ</a>| <a href="http://tzkanglong.com" target="_blank">޹Ʒѹۿ</a>| <a href="http://lijieedu.com" target="_blank">һ˿wwwƵ߹ۿ</a>| <a href="http://htsp777.com" target="_blank">޾Ʒһ</a>| <a href="http://sese3366.com" target="_blank">޾ƷþþӰԺӰƬ</a>| <a href="http://mt181.com" target="_blank">Ůɫһ</a>| <a href="http://266hd.com" target="_blank">99Ʒѹۿ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>