亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

?? restopeer.java

?? p2p 源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
	// the brand name of RestoPeer. So each RestoPeer instance	// must have a unique name.	myAdv.setName("RestoNet:RestoPipe:" + brand);	myAdv.setType(PipeService.UnicastType);	// Create the module impl advertisement that represents	// the RestoPeer service.	// Peergroup services are also represented by modules since a	// peergroup service needs to be dynamically loaded when the	// corresponding peergroup is instantiated on the peer.	// The constructor of the service 	// module impl takes a set of arguments to describe the service:	//    msrvID : unique spec ID of the restoNet service	//    "RestoPeerService" : is the java class implementing the service	//    "http://jxta.org/tutorial/RestoPeer.jar" : location to find jar file	//    "sun.com" : provider of the service	//    a description of the service        ModuleImplAdvertisement restoImplAdv =                createServiceModuleImplAdv(msrvID,		"RestoPeerService", "http://jxta.org/tutorial/RestoPeer.jar",		"sun.com","RestoPeer Service Module Implementation", myAdv);        // Create a new peergroup that is a clone of the NetPeergroup        // but with the added RestoPeer Service.        return createPeerGroup(netpg, "RestoNet", restoImplAdv);    }    // This is a utility method to create a new peergroup    // implementation. The new peergroup will have all the    // same services as the parent peergroup; it will have an    // additional service (the srvImpl).    //     // The method creates the    // new Peer Group Module Implementation Advertisement and    // publishes it; creates the associated PeerGroup Adv and    // publishes it; and instantiates the peergroup    // using the just created PeerGroup Adv.    //      // parent: parent peergroup the new group is created into    // groupName : name of the new group    // srvImpl :  new peergroup service to add to the default set of    //            NetPeergroup services    private PeerGroup  createPeerGroup(PeerGroup parent, String groupName, 				       ModuleImplAdvertisement srvImpl) {        PeerGroup myPeerGroup = null;        PeerGroupAdvertisement myPeerGroupAdvertisement = null;        ModuleImplAdvertisement myModuleImplAdv = null;                // Create the PeerGroup Module Implementation adding the	// new peergroup service        myModuleImplAdv = createPeerGroupModuleImplAdv(parent, srvImpl);        // Publish the new peergroup module implementation in the        // parent peer group        DiscoveryService parentDiscovery = parent.getDiscoveryService();        // Publish advertisement in the parent peergroup with the default        // lifetime and expiration time for remote publishing        try {            parentDiscovery.publish(myModuleImplAdv, DiscoveryService.ADV, 		PeerGroup.DEFAULT_LIFETIME, PeerGroup.DEFAULT_EXPIRATION);            parentDiscovery.remotePublish(myModuleImplAdv,                DiscoveryService.ADV, PeerGroup.DEFAULT_EXPIRATION);        }        catch (java.io.IOException e) {            System.err.println(                "Cannot publish the new peergroup ModuleImplAdv");            return null;        }    	System.out.println(                "Published new Peergroup ModulImpl advertisement for : "                + groupName);        // Create and publish the new PeerGroup Advertisement        // corresponding to the new peergroup implementation        myPeerGroupAdvertisement= createPeerGroupAdvertisement(				  myModuleImplAdv,groupName);        // Publish the advertisementin the parent peer group with the        // default lifetime and expiration time        try {            parentDiscovery.publish(myPeerGroupAdvertisement,                DiscoveryService.GROUP, PeerGroup.DEFAULT_LIFETIME,                PeerGroup.DEFAULT_EXPIRATION);            parentDiscovery.remotePublish(myPeerGroupAdvertisement,                DiscoveryService.GROUP, PeerGroup.DEFAULT_EXPIRATION);        }        catch (java.io.IOException e) {            System.err.println("Cannot create the new PeerGroupAdvertisement");	    return null;        }	System.out.println("Published the new PeerGroup advertisement for :"	    + groupName);	try {	    // Finally, instantiate the new PeerGroup            myPeerGroup = parent.newGroup(myPeerGroupAdvertisement);	    System.out.println("Instantiated the new PeerGroup " + groupName);        } catch (net.jxta.exception.PeerGroupException e) {            System.err.println("Cannot create the new Peer Group");            return null;        }        return myPeerGroup;    }    // This method is a generic method used to create a new    // module impl advertisement for representing a peergroup    // service. Each module implementation corresponds to a unique    // module spec id that uniquely identifies a peergroup service.    //    // A peergroup service is represented by:    //     id: unique module spec id identifying the new peergroup service    //     code: java class that implement the peergroup service    //     uri: location where we can download the java class implementing the service    //     provider: identity of the provider    //     desc: description of the service.    //     padv: pipe advertisement to invoke the service    private  ModuleImplAdvertisement createServiceModuleImplAdv(               ModuleSpecID id,	       String       code,	       String       uri,	       String       provider,	       String       desc,	       PipeAdvertisement padv) {	// Construct a new module implementation advertisment        ModuleImplAdvertisement ServiceModuleImplAdv =            (ModuleImplAdvertisement)            AdvertisementFactory.newAdvertisement(                ModuleImplAdvertisement.getAdvertisementType());	// Set a unique module Spec ID associated with this	// service implementation        ServiceModuleImplAdv.setModuleSpecID(id);	// Set the java class that implements this service        ServiceModuleImplAdv.setCode(code);		// Set the description of the new service        ServiceModuleImplAdv.setDescription(desc);	// Define the compatibility Java JDK1.4 for loading this module	StructuredTextDocument doc = (StructuredTextDocument)                StructuredDocumentFactory.newStructuredDocument(                    new MimeMediaType("text", "xml"), "Comp");        Element e = doc.createElement("Efmt", "JDK1.4");        doc.appendChild(e);        e = doc.createElement("Bind", "V1.0 Ref Impl");        doc.appendChild(e);        ServiceModuleImplAdv.setCompat(doc);	// Set the URL where we can download the code for this module        ServiceModuleImplAdv.setUri(uri);	// Set the provider for this module        ServiceModuleImplAdv.setProvider(provider);	// Set the pipe advertisement into a param doc to be used 	// by a peer to connect to the service	StructuredTextDocument paramDoc = (StructuredTextDocument)                 StructuredDocumentFactory.newStructuredDocument                 (new MimeMediaType("text/xml"), "Parm");        StructuredDocumentUtils.copyElements(paramDoc, paramDoc,			 (Element) padv.getDocument(new MimeMediaType("text/xml")));        ServiceModuleImplAdv.setParam(paramDoc);	// Return the new module implementation for this service        return ServiceModuleImplAdv;    }    // Create a Module Impl Advertisement that represents a peergroup    // which is a clone of the NetPeerGroup, but adds a new peergroup    // service to the peergroup.    private ModuleImplAdvertisement createPeerGroupModuleImplAdv(                PeerGroup parent, 		ModuleImplAdvertisement serviceModuleImplAdv) {        ModuleImplAdvertisement allPurposePeerGroupImplAdv = null;        StdPeerGroupParamAdv PeerGroupParamAdv = null;        try {	    // Clone the parent (NetPeerGroup) implementation to get	    // a module implementation            allPurposePeerGroupImplAdv =                parent.getAllPurposePeerGroupImplAdvertisement();        }        catch (Exception e) {            System.err.println("Cannot get allPurposePeerGroupImplAdv " + e);	    return null;        }        	// Get the param field that conatins all the peergroup services	// associated with the peergroup        try {            PeerGroupParamAdv = new StdPeerGroupParamAdv(			        allPurposePeerGroupImplAdv.getParam());        }        catch (PeerGroupException e) {            System.err.println("Cannot get StdPeerGroupParamAdv " + e); 	    return null;        }		// Get the hashtable containaing the list of all the peergroup	// services from the param advertisements        Hashtable allPurposePeerGroupServicesHashtable =            PeerGroupParamAdv.getServices();	// Add our new peergroup service to the list of peergroup services	allPurposePeerGroupServicesHashtable.put(mcID, serviceModuleImplAdv);		// Update the PeerGroupModuleImplAdv with our new list	// of peergroup services	allPurposePeerGroupImplAdv.setParam((Element) 	        PeerGroupParamAdv.getDocument(new MimeMediaType("text/xml")));	// Set the new unique Spec ID that identifies this new peergroup	// implementation	allPurposePeerGroupImplAdv.setModuleSpecID(msID);         // We are done creating our new peergroup implementation        return allPurposePeerGroupImplAdv;    }    // This utility method is used to create a PeerGroup advertisement    // associated with a module peergroup implementation    private PeerGroupAdvertisement createPeerGroupAdvertisement(	 ModuleImplAdvertisement implAdv, String groupName) {	// Create a new peergroup advertisement        PeerGroupAdvertisement myadv = (PeerGroupAdvertisement) 	    AdvertisementFactory.newAdvertisement(	        PeerGroupAdvertisement.getAdvertisementType());                // Instead of creating a new group ID we use the        // RestoPeer pre-defined peergroup id, so we create the same        // peergroupId each time the group	// is created        myadv.setPeerGroupID(restoPeerGroupID);	// Assign the pre-defined module spec id that corresponds	// to our peergroup module implementation        myadv.setModuleSpecID(implAdv.getModuleSpecID());		// Assign peergroup name        myadv.setName(groupName);	// Set the peergroup description        myadv.setDescription("This is RestoNet Peergroup");                return myadv;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩视频在线第一区| 久久众筹精品私拍模特| 欧洲精品视频在线观看| 日韩欧美一级二级三级久久久| 国产精品剧情在线亚洲| 99久久99久久精品免费观看| 奇米影视7777精品一区二区| 国产精品一级在线| 一本色道**综合亚洲精品蜜桃冫| 欧美日韩国产精品成人| 久久麻豆一区二区| 亚洲国产精品久久久久婷婷884| 久久国产尿小便嘘嘘| 91视视频在线观看入口直接观看www | 精品电影一区二区| 亚洲成人免费视频| 国产精品一区二区在线观看网站| 99在线精品观看| 日韩欧美精品三级| 曰韩精品一区二区| 国模大尺度一区二区三区| 在线观看一区不卡| 久久久久综合网| 亚洲成人一区在线| av一区二区三区| 日韩一级二级三级精品视频| 亚洲天堂福利av| 激情欧美日韩一区二区| 色爱区综合激月婷婷| 日韩欧美国产高清| 亚洲图片欧美色图| 成人精品电影在线观看| 欧美大尺度电影在线| 一区二区三区精品视频在线| 成人免费视频免费观看| 精品日韩av一区二区| 亚洲成av人片在线| 96av麻豆蜜桃一区二区| 欧美不卡视频一区| 丝袜国产日韩另类美女| 91国产精品成人| 国产精品久久午夜夜伦鲁鲁| 精品亚洲国内自在自线福利| 欧美色图第一页| 综合久久久久久| 国产美女精品人人做人人爽| 日韩欧美色综合网站| 亚洲国产日韩综合久久精品| 99久久精品国产毛片| 国产欧美一区二区三区沐欲| 精一区二区三区| 91精品在线麻豆| 性做久久久久久免费观看| 色偷偷久久人人79超碰人人澡| 欧美国产成人在线| 国产成人精品综合在线观看| 欧美精品一区二区三区高清aⅴ| 日本一区中文字幕| 7777精品伊人久久久大香线蕉| 亚洲愉拍自拍另类高清精品| 成人av集中营| 中文字幕亚洲视频| 99视频超级精品| 亚洲色图视频网站| 91亚洲国产成人精品一区二区三| 国产精品电影一区二区| 不卡在线视频中文字幕| 一区二区中文视频| 99久久婷婷国产| 亚洲免费观看高清完整版在线观看 | 成人网在线免费视频| 国产色婷婷亚洲99精品小说| 国内精品国产成人国产三级粉色| 欧美一级黄色片| 久久国内精品自在自线400部| 日韩视频永久免费| 精东粉嫩av免费一区二区三区| 欧美mv和日韩mv的网站| 韩国v欧美v日本v亚洲v| 国产三级三级三级精品8ⅰ区| 韩日欧美一区二区三区| 久久久久国色av免费看影院| 国产精品99久久久| 欧美国产精品中文字幕| 91色porny在线视频| 亚洲一区二区欧美| 69堂成人精品免费视频| 激情五月婷婷综合| 国产欧美一区二区三区鸳鸯浴| 成人动漫av在线| 亚洲精品视频一区二区| 欧美日本高清视频在线观看| 蜜桃久久av一区| 国产日本欧美一区二区| 91网站在线播放| 性感美女久久精品| 欧美成人a∨高清免费观看| 高清国产午夜精品久久久久久| 综合欧美亚洲日本| 在线不卡a资源高清| 经典三级在线一区| 中文字幕永久在线不卡| 欧美日韩久久久| 久久99国产精品成人| 国产精品色呦呦| 在线观看国产一区二区| 免费成人在线网站| 国产精品美女久久久久久| 欧美中文字幕一区二区三区亚洲| 美女诱惑一区二区| 国产精品私房写真福利视频| 91论坛在线播放| 日本色综合中文字幕| 中文字幕欧美日韩一区| 欧美性色黄大片| 国产精品一区二区x88av| 亚洲欧美日韩成人高清在线一区| 制服丝袜成人动漫| 成人av片在线观看| 日韩精品一区第一页| 欧美激情一区二区三区在线| 欧美最猛性xxxxx直播| 国产伦精品一区二区三区在线观看| 国产精品成人免费| 日韩精品中文字幕一区 | 一区二区免费在线播放| 精品88久久久久88久久久| av网站一区二区三区| 美女视频黄a大片欧美| 亚洲六月丁香色婷婷综合久久 | 国产一区二区调教| 亚洲在线中文字幕| 国产日韩成人精品| 7777精品伊人久久久大香线蕉的| 北条麻妃一区二区三区| 奇米色一区二区三区四区| 亚洲精品免费看| 国产日韩欧美精品一区| 在线综合+亚洲+欧美中文字幕| 不卡一区在线观看| 经典一区二区三区| 天堂va蜜桃一区二区三区漫画版| 国产精品色呦呦| 精品久久久久一区二区国产| 91国偷自产一区二区三区成为亚洲经典| 国产一区二区福利| 日韩成人精品在线| 悠悠色在线精品| 国产精品国产a| 久久嫩草精品久久久久| 91精品国产综合久久久久| 在线免费精品视频| 99亚偷拍自图区亚洲| 欧美sm美女调教| 亚洲愉拍自拍另类高清精品| 国产成人自拍在线| 国产日韩视频一区二区三区| 成人综合激情网| 亚洲免费观看高清完整版在线观看熊 | 日韩精品专区在线| 国产精品99久久久久| 亚洲天堂中文字幕| 欧美区在线观看| 国产精品精品国产色婷婷| 色婷婷综合中文久久一本| 国产精品66部| 国产一区二区三区高清播放| 视频在线在亚洲| 亚洲成人免费影院| 亚洲国产精品精华液网站| 亚洲欧美激情插| 亚洲欧美在线观看| 中文字幕在线播放不卡一区| 中文字幕精品一区二区三区精品| 久久综合资源网| 久久综合精品国产一区二区三区| 欧美一级高清大全免费观看| 欧美日韩一级二级| 欧美日韩电影一区| 欧美日韩国产一级片| 欧美性三三影院| 国产aⅴ综合色| 欧美四级电影在线观看| 99精品国产99久久久久久白柏| 成人av在线资源| 91香蕉视频mp4| 日本乱人伦aⅴ精品| 欧美中文字幕一区二区三区亚洲| 日本久久一区二区| 欧洲亚洲精品在线| 欧美午夜电影一区| 欧美精品在线一区二区| 欧美一级生活片| 26uuu另类欧美| 国产欧美日韩另类视频免费观看| 国产亚洲一区二区三区四区 | 精久久久久久久久久久| 国精品**一区二区三区在线蜜桃| 国产·精品毛片| 一本到三区不卡视频|