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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? restopeer.java

?? JXTA技術手冊 書上3.4.5章的源代碼
?? 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一区二区三区免费野_久草精品视频
99re这里只有精品6| 91在线国产福利| 亚洲h动漫在线| 一区二区不卡在线播放| 亚洲欧美在线高清| 国产精品久久99| 中文字幕一区二区5566日韩| 久久久精品一品道一区| 久久精品一区二区三区不卡牛牛| 欧美mv和日韩mv的网站| 欧美大片一区二区| 日韩精品中文字幕一区| 精品欧美一区二区久久| 精品国产一区久久| 国产亚洲婷婷免费| 国产精品传媒入口麻豆| 亚洲免费在线视频一区 二区| 亚洲少妇30p| 亚洲国产成人高清精品| 五月婷婷色综合| 理论电影国产精品| 国产成人精品免费网站| 成人免费毛片嘿嘿连载视频| 成人免费高清在线| 欧美亚洲愉拍一区二区| 日韩一区二区三区高清免费看看| 精品国产自在久精品国产| 欧美国产欧美综合| 亚洲一区二三区| 美腿丝袜亚洲一区| 成人精品免费视频| 精品视频在线视频| 久久综合av免费| 成人免费在线视频观看| 亚洲成人一区二区| 国产精品一区免费视频| 91在线观看免费视频| 91精品国产综合久久久久久| 久久久国产精华| 亚洲成人在线观看视频| 国产精品亚洲综合一区在线观看| 色哟哟国产精品| 日韩欧美激情一区| 亚洲色图欧美在线| 黄色日韩网站视频| 欧美日韩国产另类一区| 中文字幕第一区二区| 天天色综合天天| 成人禁用看黄a在线| 91精品久久久久久久91蜜桃| 1000部国产精品成人观看| 日本人妖一区二区| 色婷婷精品大视频在线蜜桃视频| 精品国产乱码久久久久久久久| 亚洲美女淫视频| 国产酒店精品激情| 91精品综合久久久久久| 尤物av一区二区| 波多野结衣视频一区| 日韩一区二区三区免费观看| 一区二区三国产精华液| 国产.欧美.日韩| 精品成人佐山爱一区二区| 亚洲国产精品一区二区www在线 | 不卡av在线免费观看| 精品国内二区三区| 日本美女视频一区二区| 色婷婷久久久综合中文字幕| 欧美激情艳妇裸体舞| 国产精品一线二线三线精华| 日韩美女在线视频| 亚洲chinese男男1069| 一本色道久久综合亚洲91| 国产精品福利在线播放| 粉嫩av一区二区三区在线播放 | 国产亚洲欧洲997久久综合| 蜜臂av日日欢夜夜爽一区| 欧美另类z0zxhd电影| 亚洲成人av福利| 欧美三级视频在线播放| 亚洲成人av电影在线| 欧美日韩色一区| 香蕉久久夜色精品国产使用方法| 欧美亚洲日本一区| 五月天久久比比资源色| 欧美日韩中文另类| 青青草成人在线观看| 日韩精品最新网址| 国模冰冰炮一区二区| 欧美高清在线一区二区| 成人激情动漫在线观看| 亚洲精品国产无天堂网2021| 欧美三级日韩三级国产三级| 日韩av二区在线播放| 欧美tickling网站挠脚心| 国产激情一区二区三区| 中文字幕五月欧美| 欧美丝袜自拍制服另类| 乱一区二区av| 国产婷婷色一区二区三区| 97精品电影院| 日本成人超碰在线观看| 久久久国产午夜精品 | 亚洲最大成人综合| 日韩免费观看2025年上映的电影| 久久国产三级精品| 国产精品免费aⅴ片在线观看| 欧美午夜一区二区三区| 久久国产精品99久久人人澡| 国产精品色呦呦| 欧美人xxxx| 精品一区二区三区视频在线观看| 国产精品嫩草影院com| 91精品国产免费| 粉嫩av一区二区三区| 亚洲一区二区高清| 国产人妖乱国产精品人妖| 色伊人久久综合中文字幕| 久久精品99国产精品| 国产精品国产三级国产专播品爱网| 在线观看91视频| 国产在线播精品第三| 亚洲伊人伊色伊影伊综合网| 久久婷婷国产综合国色天香 | 欧美影院一区二区三区| 久久er精品视频| 亚洲高清一区二区三区| 久久久久久日产精品| 欧美精品第1页| jizz一区二区| 国产伦理精品不卡| 天堂成人免费av电影一区| 亚洲欧洲一区二区在线播放| 欧美精品一区二区三| 精品视频全国免费看| 99精品视频一区二区三区| 国内精品写真在线观看| 偷窥少妇高潮呻吟av久久免费| 亚洲日本在线视频观看| 欧美国产激情二区三区| 久久久精品日韩欧美| 精品国产一区二区三区四区四| 欧美日韩午夜在线| 在线观看www91| 色综合欧美在线| 99久久精品国产观看| 国产成人亚洲综合a∨猫咪| 激情综合五月婷婷| 久久99久国产精品黄毛片色诱| 午夜亚洲国产au精品一区二区 | 欧美日韩激情在线| 波多野结衣中文字幕一区| 成人小视频免费在线观看| 国产另类ts人妖一区二区| 久久成人18免费观看| 久久91精品久久久久久秒播| 麻豆精品视频在线观看视频| 亚洲成a人片综合在线| 亚洲一线二线三线久久久| 亚洲欧美日韩在线不卡| 亚洲精品国产无天堂网2021| 亚洲精品日韩一| 亚洲综合免费观看高清完整版在线| 亚洲欧美另类久久久精品2019| 国产精品女主播av| 中文字幕综合网| 亚洲香肠在线观看| 爽好久久久欧美精品| 丝袜美腿亚洲综合| 六月丁香婷婷久久| 成人精品在线视频观看| av一区二区三区| 91久久精品国产91性色tv| 欧美丝袜丝交足nylons图片| 欧美一区二区网站| 国产亚洲精品aa| 亚洲天堂av一区| 午夜电影网一区| 国产乱妇无码大片在线观看| www.欧美.com| 欧美日韩成人高清| 久久综合久久综合亚洲| 中文在线一区二区| 亚洲精品成a人| 日韩激情视频网站| 国产成人精品三级麻豆| 欧美优质美女网站| 26uuu精品一区二区三区四区在线| 国产视频视频一区| 亚洲成人自拍偷拍| 国产精品自在欧美一区| 在线中文字幕一区| 久久只精品国产| 亚洲一区二区精品视频| 国产麻豆视频一区| 欧美色中文字幕| 日本一区二区三区视频视频| 亚洲欧美电影一区二区| 国产在线精品免费av| 日本电影亚洲天堂一区|