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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? rmiendpoint.java

?? Chord package into p2psim
?? JAVA
字號(hào):
/***************************************************************************
 *                                                                         *
 *                             RMIEndpoint.java                            *
 *                            -------------------                          *
 *   date                 : 22.02.2008, 14:10:40                           *
 *   copyright            : (C) 2008 Distributed and                       *
 *                              Mobile Systems Group                       *
 *                              Lehrstuhl fuer Praktische Informatik       *
 *                              Universitaet Bamberg                       *
 *                              http://www.uni-bamberg.de/pi/              *
 *   email                : sven.kaffille@uni-bamberg.de                   *
 *                                                                         *
 *                                                                         *
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   A copy of the license can be found in the license.txt file supplied   *
 *   with this software or at: http://www.gnu.org/copyleft/gpl.html        *
 *                                                                         *
 ***************************************************************************/
package de.uniba.wiai.lspi.chord.com.rmi;

import java.rmi.AccessException;
import java.rmi.AlreadyBoundException;
import java.rmi.NotBoundException;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

import de.uniba.wiai.lspi.chord.com.CommunicationException;
import de.uniba.wiai.lspi.chord.com.Endpoint;
import de.uniba.wiai.lspi.chord.com.Entry;
import de.uniba.wiai.lspi.chord.com.Node;
import de.uniba.wiai.lspi.chord.com.RefsAndEntries;
import de.uniba.wiai.lspi.chord.data.ID;
import de.uniba.wiai.lspi.chord.data.URL;

public final class RMIEndpoint extends Endpoint implements RemoteNode {

	private Registry registry = null;

	private RemoteNode remoteNode = null;

	static final String NAME_IN_REGISTRY = "oc_endpoint_";

	public RMIEndpoint(Node node1, URL url1) {
		super(node1, url1);
	}

	/**
	 * Can only be called if Endpoint is not in state STARTED!
	 * @return
	 */
	RemoteNode getRemoteNode() {
		if (this.remoteNode == null) {
			throw new IllegalStateException();
		}
		return this.remoteNode;
	}

	@Override
	protected void closeConnections() {
		try {
			UnicastRemoteObject.unexportObject(this, true);
			registry.unbind(NAME_IN_REGISTRY + this.url.toString());
			this.setState(STARTED);
		} catch (AccessException e) {
		} catch (RemoteException e) {
		} catch (NotBoundException e) {
		}
	}

	@Override
	protected void entriesAcceptable() {
		this.setState(ACCEPT_ENTRIES);
	}

	@Override
	protected void openConnections() {
		try {
			if (registry == null) {
				registry = LocateRegistry.createRegistry(this.url.getPort());
			}
			Remote remoteRef;
			remoteNode = (RemoteNode) UnicastRemoteObject.exportObject(this);
			registry.bind(NAME_IN_REGISTRY + this.url.toString(), remoteNode);
			this.setState(LISTENING);
		} catch (RemoteException e) {
			throw new RuntimeException(e);
		} catch (AlreadyBoundException e) {
			throw new RuntimeException(e);
		}
	}

	private RemoteNodeInfo createInfo(Node node) {
		if (node.getNodeID().equals(this.node.getNodeID())) {
			return new RemoteNodeInfo(remoteNode, this.node.getNodeID(),
					this.node.getNodeURL());
		} else {
			return new RemoteNodeInfo(((RMIProxy) node).getRemoteNode(), node
					.getNodeID(), node.getNodeURL());
		}
	}

	public RemoteNodeInfo findSuccessor(ID key) throws CommunicationException,
			RemoteException {
		try {
			Node node = this.node.findSuccessor(key);
			return createInfo(node);
		} catch (ClassCastException e) {
			throw new RemoteException(
					"Remote node uses unsuitable communication protocol!", e);
		}
	}

	public ID getNodeID() throws RemoteException {
		return this.node.getNodeID();
	}

	public void insertEntry(Entry entryToInsert) throws RemoteException,
			CommunicationException {
		this.node.insertEntry(entryToInsert);
	}

	public void insertReplicas(Set<Entry> entries) throws RemoteException,
			CommunicationException {
		this.node.insertReplicas(entries);
	}

	public void leavesNetwork(RemoteNodeInfo predecessor)
			throws RemoteException, CommunicationException {
		this.node.leavesNetwork(new RMIProxy(predecessor, this.getURL()));
	}

	public List<RemoteNodeInfo> notify(RemoteNodeInfo potentialPredecessor)
			throws RemoteException, CommunicationException {
		List<Node> nodes = this.node.notify(new RMIProxy(potentialPredecessor,
				this.getURL()));
		List<RemoteNodeInfo> result = new LinkedList<RemoteNodeInfo>();
		for (Node node : nodes) {
			result.add(this.createInfo(node));

		}
		return result;
	}

	public RemoteRefsAndEntries notifyAndCopyEntries(
			RemoteNodeInfo potentialPredecessor) throws RemoteException,
			CommunicationException {
		RefsAndEntries raes = this.node.notifyAndCopyEntries(new RMIProxy(
				potentialPredecessor, this.getURL()));
		List<RemoteNodeInfo> rNodes = new LinkedList<RemoteNodeInfo>();
		List<Node> nodes = raes.getRefs();
		for (Node node : nodes) {
			rNodes.add(this.createInfo(node));
		}
		return new RemoteRefsAndEntries(raes.getEntries(), rNodes);
	}

	public void ping() throws RemoteException {
	}

	public void removeEntry(Entry entryToRemove) throws RemoteException,
			CommunicationException {
		this.node.removeEntry(entryToRemove);
	}

	public void removeReplicas(ID sendingNode, Set<Entry> replicasToRemove)
			throws RemoteException, CommunicationException {
		this.node.removeReplicas(sendingNode, replicasToRemove);

	}

	public Set<Entry> retrieveEntries(ID id) throws RemoteException,
			CommunicationException {
		return this.node.retrieveEntries(id);
	}
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美久久婷婷综合色| 欧美午夜精品久久久久久孕妇| 亚洲桃色在线一区| 欧美精品在线观看一区二区| 国产一区二区伦理片| 亚洲精品v日韩精品| 精品国产一区二区三区不卡| 91网上在线视频| 韩国v欧美v日本v亚洲v| 亚洲一二三专区| 国产精品嫩草99a| 五月婷婷激情综合网| 亚洲国产精品国自产拍av| 欧美精品在欧美一区二区少妇| 972aa.com艺术欧美| 精品一区二区三区在线观看| 亚洲高清免费在线| 亚洲日本乱码在线观看| 久久免费电影网| 欧美一区二区日韩一区二区| 在线亚洲人成电影网站色www| 国产精品白丝jk白祙喷水网站| 亚洲国产日韩精品| 亚洲免费观看视频| 国产精品视频看| 国产人伦精品一区二区| 日韩欧美一级二级| 日韩亚洲电影在线| 欧美精品粉嫩高潮一区二区| 日本韩国欧美在线| 99re这里只有精品6| 成人国产精品免费| 成熟亚洲日本毛茸茸凸凹| 美女精品自拍一二三四| 免费美女久久99| 另类人妖一区二区av| 奇米888四色在线精品| 视频一区中文字幕| 日韩中文字幕一区二区三区| 性欧美大战久久久久久久久| 亚洲国产你懂的| 亚洲国产一区视频| 丝袜诱惑亚洲看片| 丝袜美腿成人在线| 日韩电影网1区2区| 麻豆专区一区二区三区四区五区| 日韩黄色片在线观看| 天天综合色天天| 日本vs亚洲vs韩国一区三区二区 | 日韩高清欧美激情| 日日夜夜精品视频天天综合网| 亚洲一区二区不卡免费| 亚洲mv在线观看| 日本免费新一区视频| 久久国产夜色精品鲁鲁99| 国产在线国偷精品免费看| 国产精品一卡二卡| 99久久国产免费看| 欧美日韩高清影院| 日韩欧美第一区| 国产天堂亚洲国产碰碰| 中文字幕一区二区三区四区不卡 | 欧美日韩小视频| 91精品国产色综合久久ai换脸| 欧美一级高清片在线观看| 精品日韩一区二区三区| 国产网红主播福利一区二区| 亚洲欧洲日本在线| 午夜成人免费视频| 久久69国产一区二区蜜臀| 粉嫩在线一区二区三区视频| 91久久精品一区二区三| 欧美浪妇xxxx高跟鞋交| 久久蜜桃av一区精品变态类天堂 | 欧美一区二区观看视频| 久久久精品蜜桃| 亚洲资源在线观看| 精品一区二区三区不卡| 波多野结衣中文一区| 欧美精品丝袜中出| 国产亚洲制服色| 亚洲国产乱码最新视频 | 成人免费三级在线| 欧美日韩亚洲综合一区| 欧美精品一区二区高清在线观看 | 亚洲成人动漫在线观看| 国产综合色精品一区二区三区| 成人av在线资源网站| 91精品国产综合久久久久久久| 国产精品欧美精品| 日日夜夜免费精品| 91蝌蚪porny| 精品精品欲导航| 亚洲人成网站精品片在线观看| 捆绑调教美女网站视频一区| 91丨国产丨九色丨pron| 日韩精品一区二区三区视频在线观看| 亚洲欧洲日产国码二区| 国产制服丝袜一区| 欧美私人免费视频| 日本一二三四高清不卡| 久久精品国产网站| 欧美视频一区二区在线观看| 国产午夜亚洲精品羞羞网站| 在线欧美日韩国产| 欧美国产一区视频在线观看| 青青草91视频| 欧美日韩黄色一区二区| 亚洲人被黑人高潮完整版| 国产美女视频91| 色综合欧美在线| 欧美国产国产综合| 狠狠狠色丁香婷婷综合激情| 欧美日韩一卡二卡三卡| 亚洲欧美偷拍卡通变态| 国产激情偷乱视频一区二区三区| 4438成人网| 亚洲一级二级三级在线免费观看| 97久久超碰国产精品| 欧美高清在线一区| 国产伦精一区二区三区| 日韩女优视频免费观看| 亚洲成av人片在线观看无码| 91蜜桃视频在线| 中文字幕在线不卡| 国产成人免费xxxxxxxx| 久久婷婷久久一区二区三区| 秋霞成人午夜伦在线观看| 欧美亚洲国产一区在线观看网站| 亚洲欧美在线aaa| 成人av综合在线| 国产日韩欧美电影| 国内外成人在线视频| 久久只精品国产| 国产美女精品在线| 26uuu久久天堂性欧美| 麻豆精品在线观看| 精品日韩在线观看| 国产一区二区成人久久免费影院 | 成人激情免费网站| 国产精品久久夜| 播五月开心婷婷综合| 亚洲人成网站影音先锋播放| 91丨porny丨首页| 一区二区三区在线视频观看58| 99精品视频在线免费观看| 日韩理论片在线| 欧美伊人久久久久久久久影院| 一区二区三区免费在线观看| 91福利国产精品| 日韩二区三区四区| 2024国产精品| 高清国产一区二区三区| 自拍av一区二区三区| 色播五月激情综合网| 亚洲亚洲人成综合网络| 日韩一级完整毛片| 国产呦萝稀缺另类资源| 日本一区二区综合亚洲| 99麻豆久久久国产精品免费| 亚洲精品国产成人久久av盗摄| 欧美日韩一区成人| 麻豆国产一区二区| 国产嫩草影院久久久久| 日本高清成人免费播放| 日本亚洲视频在线| 久久这里只精品最新地址| 豆国产96在线|亚洲| 亚洲精品大片www| 日韩欧美一区中文| 成人h精品动漫一区二区三区| 亚洲激情成人在线| 欧美一区二区不卡视频| 国产成+人+日韩+欧美+亚洲| 亚洲另类春色校园小说| 欧美一级高清片| eeuss鲁一区二区三区| 视频一区在线视频| 国产精品久久久久婷婷| 欧美人xxxx| 国产成人精品一区二| 亚洲第一主播视频| 国产日本欧洲亚洲| 777久久久精品| 成人精品gif动图一区| 日韩黄色一级片| 中文字幕色av一区二区三区| 91精品黄色片免费大全| 成人av动漫网站| 麻豆精品视频在线观看免费| 中文字幕在线观看一区二区| 欧美精品三级在线观看| 成人高清在线视频| 麻豆国产精品一区二区三区 | 日韩精品专区在线| 色婷婷av一区二区| 国产精品一区二区视频| 丝袜美腿亚洲一区| 亚洲欧美激情在线| 国产无人区一区二区三区|