想搞清楚remotePublish可以看看这篇文章(考验英语水平的时间到了_第1页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、想搞清楚remotepublish可以看看这篇文章(考验英语水平的时间到了 don't rely on remotepublish() by bondolo on apr 20, 2007 sie it's earliest versions the jxta jse api has includ remotepublish() as part of the discovery api. this is unfortunate because remotepublish() is frequently misu and it's not really that usef

2、ul to begin with. some jxta users assume that advertisements must be remote published to another peer in order for the advertisement to be discovered. this is not true! un the advertisement needs to discoverable while the peer is unreachable or offline then local publiion is almost always sufficient

3、. part of the confusion is undoubtably e to the presence of two methods, publish() and remotepublish(). in the jxta jse and jxta-c apis remotepublish() and publish() are separate apis for implementation efficiency reasons only. you should conser advertisement publication as only one concept-the publ

4、ish operation with an option for remote republication. remote publication is intended to be only a means for easily requesting remote republication. in every case where remotepublish() is used it should be accompanied by appropriate local publication. what remotepublish() does : send the provided ad

5、vertisement to remote peers may republish the advertisement locally. there a couple of big question marks that should arise from this ement. what is gained by having the other peers republish one of my advertisements?which other peers will be receiving the advertisement?will the peers receive the ad

6、vertisement accept my request and actually publish my advertisement? let's delve into these questions a little further. peers publish advertisements to allow other peers to discover their resources. noally the advertisements published by a peer refer either directly or indirectly to that peer. d

7、irect references to the publishing peer most commonly are it's peerid but can ao include the peer's name or other application specificidentifiers. indirect references include the pipeids for pipes the peer is listening on or references to other advertisements that the peer has also published

8、. even indirect references include descriptions of services that the publishing peer might be running. for advertisements with direct references it is certainly best if the publishing peer itself is the responder when queries are made for the advertisement. not only does this ensure that the queryin

9、g peer receives the most recent version of the advertisement it also ensures that the querying peer receives only active advertisements. for queries which return multiple results having only the original publisher respond can also improve the relevance of responses since responses will be generated

10、only by (and referring to) active peers. for advertisements with indirect peer references it's less important that the originating peer be the peer that responds to queries for the advertisement, but the same advantages that apply for advertisements with direct references may still apply. this i

11、s particularly true for pipe advertisements. the peers which respond should be the peers which are listening on the pipe. in cases where the same advertisement applies to many peers, as is common for pipe advertisements, as long as one of the publishers responds then the query will be satisfied. so

12、what's gained by having your advertisement republished via remotepublish() by other peers and when is it useful? remote republication does provide an aitional (an usually unnecessary) source for your advertisement. it also may make your peer's advertisement available when your peer is not av

13、ailable. this may or may not be a benefit as it could result in other peers wasting trying to contact your peer when it is unreachable. once you've decided that you want your advertisement republished by other peers you are still faced with two additional questions, "which peers can i ask t

14、o republish my advertisement and will they do so?" there are no simple answers to these questions and the answers are not consistent. these questions are icult to answer for many reasons not limited to; varying network topologies, varying network policies and peer autonomy. remotepublish() is a

15、 request you make to other peers on the network. there is no way to force the other peers to accept your request nor is there guaran that any other peers are even listening. in remotepublish()'s default form no particular peer is asked to perform the republication, any peer receiving the message

16、 is requested to republish the advertisement. even when you designate a specific peer with remotepublish() it is not required to accept your advertisement. a peer may choose to ignore your request due to space limitations, a configured policy or any other reason and it will not inform your peer of i

17、t's refusal. assuming another peer does choose to accept your remotepublish() republication request the peer may not retain the advertisement for the entire time you requested. peers often place tight limits on the total number of advertisements they are willing to republish or on the expiration

18、 time of advertisements received through remotepublish(). you may be wondering if there is any special interaction between remotepublish() and the rendezvous service. while it is true that in most network configurations a rendezvous peer is likely to receive all remotepublish() requests from it'

19、s client peers, rendezvous server peers do not offer any special republication privileges to their clients. all of the preceding restrictions still apply. in particular, the restrictions on advertisement expiration were added to jxta implementations specifically to prevent rendezvous server peers fr

20、om being flooded with long-lived bogus advertisements. here's a test we've made since 2002: "does your application still work without remote publication?" since even before jxta jse 2.0 we've considered making remote publish a "no-op" for some configurations, particul

21、arly ad hoc and relayed configurations. in ad hoc the remote republications all end up as very noisy and generally pointless multicast traffic. for relayed configurations removing remotepublish() would slightly reduce relay load. since remotepublish() is occasionally useful and can sometimes slightly improve performance by reducing the number of hops a query must travel we've so far left it d. a properly written jxta applicati

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论