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

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

?? registrydelegate.java

?? 編了一個簡單的聊天器
?? JAVA
字號:
/* 
 * This file has been generated by the RMI Plugin for Eclipse. 
 */

//package_decl

import java.rmi.*;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.*;

/**
 * <p>
 * This class implements the registry delegate concept. 
 * <p>
 * In order to enforce some level of security, the standard RMI 
 * registry implementation (e.g. <code>rmiregistry.exe</code>) 
 * only allows processes on the same host to register objects 
 * in the registry (think of a bank running a registry on one of its servers, 
 * and doesn't want anybody modifying it). 
 * So, by design, if a process tries to {@link #bind(String, Remote)} 
 * an object to a remote registry, an exception will be thrown.
 * 
 * <p>However, the design of a distributed system may require
 * remote clients to register themselves in a central registry. If
 * such system is deployed in a controlled and trusted environment (e.g., a firewalled 
 * intranet with tight access control), the security 
 * risk may be acceptable.
 * 
 * <p>
 * The simplest technical solution to the remote registration problem 
 * is to have a registry delegate. A registry delegate is an object 
 * that serves as a proxy for the real registry. The delegate itself
 * usually appears in the registry under a well known name. It implements the {@link java.rmi.registry.Registry}
 * interface and simply delegates all method calls to the appropriate methods of the
 * real registry. The delegate is allowed to perform bind and unbind operations because 
 * it is running on the same host as the registry.
 * 
 * <p>
 * The common scenario for starting a registry and creating the delegate is starting a class with
 * the following {@link #main(String[])} method:
 * <pre>
 *   public static void main(String[] args) throws AccessException, RemoteException, AlreadyBoundException {
 *     if (System.getSecurityManager() == null) {
 *         System.setSecurityManager(new RMISecurityManager());
 *     }
 *
 *     Registry registry = LocateRegistry.createRegistry(REGISTRY_PORT);
 *     registry.bind(DELEGATE_NAME, new RegistryDelegate());
 *     
 *     do {
 *          try {
 *              Thread.sleep(Long.MAX_VALUE);
 *          } catch (InterruptedException e) {
 *              ; // do nothing
 *          } catch (Throwable e) {
 *              e.printStackTrace();
 *              System.exit(1);
 *          }
 *      } while(true);
 *   }
 * </pre>
 * 
 * The common usage scenario looks something like: 
 * <pre>
 *  Registry remoteRegistry = LocateRegistry.getRegistry("remotehost.mycompany.com");
 *  Registry delegate = (Registry) remoteRegistry.lookup(DELEGATE_NAME);
 *  delegate.bind("someName", new SomeRemoteObject());
 * </pre>
 * 
 * The {@link #getRegistryDelegate(String)} method is a helper method that fetches the 
 * registry delegate for you.
 * 
 * <p>
 * The {@link #main(String[])} method of this class will create
 * a local registry on the default port, create a registry delegate and bind it
 * under the well known name that you chose in the wizard ({@link #DELEGATE_NAME}).  
 *   
 * @see <a href="http://java.sun.com/j2se/1.4.2/docs/guide/rmi/getstart.doc.html#5912">Getting started with RMI</a>
 * @see <a href="http://www.jguru.com/faq/view.jsp?EID=1035">RMI FAQ on JGuru</a>
 * @see <a href="http://archives.java.sun.com/cgi-bin/wa?A2=ind0402&L=rmi-users&F=&S=&P=2032">RMI Mailing List post</a>
 * @see <a href="http://archives.java.sun.com/cgi-bin/wa?A2=ind0104&L=rmi-users&O=D&P=23151">RMI Mailing List post</a>
 * 
 * <!-- This file has been generated by the RMI Plugin for Eclipse. -->
 * @author Genady Beryozkin, rmi-info@genady.net
 */
public class RegistryDelegate extends UnicastRemoteObject implements Registry {
	
	/** The local resistry. */ 
	private Registry localRegistry;
	
	/** The name under which the delegate appears in the registry */
	public static final String DELEGATE_NAME = "REGISTRY_DELEGATE_NAME"; 

	/** 
	 * Create a delegate for a local registry that is bound 
	 * to the default local port (1099).
	 * @throws RemoteException if any error occurs.
	 */
	public RegistryDelegate() throws RemoteException {
		this.localRegistry = LocateRegistry.getRegistry();
	}

	/**
	 * Create a delegate for a local registry that is bound
	 * to a user specified port.
	 * @param port the local registry port.
	 * @throws RemoteException if any error occurs.
	 */
	public RegistryDelegate(int port) throws RemoteException {
		this.localRegistry = LocateRegistry.getRegistry(port);
	}

	/**
	 * Create a delegate for a user provided registry instance.
	 * The registry is assumed to be a local registry, as there
	 * is no point in creating a delegate for a remote registry.
	 * @param reg the registry for which a delegate is to be created.
	 * @throws RemoteException if any error occurrs.
	 */
	public RegistryDelegate(Registry reg) throws RemoteException {
		this.localRegistry = reg;
	}

	/* (non-Javadoc)
	 * @see java.rmi.registry.Registry#bind(java.lang.String, java.rmi.Remote)
	 */
	public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException {
		localRegistry.bind(name, obj);
	}

	/* (non-Javadoc)
	 * @see java.rmi.registry.Registry#list()
	 */
	public String[] list() throws RemoteException, AccessException {
		return localRegistry.list();
	}

	/* (non-Javadoc)
	 * @see java.rmi.registry.Registry#lookup(java.lang.String)
	 */
	public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException {
		return localRegistry.lookup(name);
	}

	/* (non-Javadoc)
	 * @see java.rmi.registry.Registry#rebind(java.lang.String, java.rmi.Remote)
	 */
	public void rebind(String name, Remote obj) throws RemoteException, AccessException {
		localRegistry.rebind(name, obj);
	}

	/* (non-Javadoc)
	 * @see java.rmi.registry.Registry#unbind(java.lang.String)
	 */
	public void unbind(String name) throws RemoteException, NotBoundException, AccessException {
		localRegistry.unbind(name);
	}
	
	/**
	 * This method retrieves the registry delegate from a registry that is running on a remote host.
	 * @param remoteHost name of the remote host.
	 * @param remotePort port on which the registry accepts requests. 
	 * @return a reference to the registry delegate.
	 * @throws RemoteException if we could not connect to the registry.
	 * @throws NotBoundException if the delegate does not appear in the registry.
	 */
	public static Registry getRegistryDelegate(String remoteHost, int remotePort) throws RemoteException, NotBoundException {
		Registry remoteRegistry = LocateRegistry.getRegistry(remoteHost, remotePort);
		return (Registry) remoteRegistry.lookup(DELEGATE_NAME);
	}

	/**
	 * This method retrieves the registry delegate from a registry that is running on a remote host.
	 * @param remoteHost name of the remote host.
	 * @return a reference to the registry delegate.
	 * @throws RemoteException if we could not connect to the registry.
	 * @throws NotBoundException if the delegate does not appear in the registry.
	 */
	public static Registry getRegistryDelegate(String remoteHost) throws RemoteException, NotBoundException {
		return getRegistryDelegate(remoteHost, REGISTRY_PORT);
	}

	/**
	 * A simple way to run a registry and bind a registry delegate.
	 * This method should be modified and adapted for the specific needs of a project.
	 */
	public static void main(String[] args) throws AccessException, RemoteException, AlreadyBoundException {
		if (System.getSecurityManager() == null) {
		    System.setSecurityManager(new RMISecurityManager());
		}

		Registry registry = LocateRegistry.createRegistry(REGISTRY_PORT);
		registry.bind(DELEGATE_NAME, new RegistryDelegate());
		
	    do {
			try {
			    Thread.sleep(Long.MAX_VALUE);
			} catch (InterruptedException e) {
				; // do nothing
			} catch (Throwable e) {
				e.printStackTrace();
				System.exit(1);
			}
		} while(true);
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆成人久久精品二区三区| 天天综合天天综合色| 欧美一二区视频| 欧美久久婷婷综合色| 欧美影片第一页| 欧美巨大另类极品videosbest| 欧美色图激情小说| 欧美日韩国产精品成人| 欧美视频日韩视频在线观看| 欧美精品九九99久久| 日韩亚洲欧美一区二区三区| 日韩精品影音先锋| 国产视频一区不卡| 18欧美乱大交hd1984| 一区二区三区欧美激情| 亚洲成人免费影院| 美女在线一区二区| 成人开心网精品视频| 成人少妇影院yyyy| 欧美四级电影在线观看| 欧美人妇做爰xxxⅹ性高电影| 日韩无一区二区| 国产欧美一区二区三区网站| 一区二区三区在线影院| 亚洲成精国产精品女| 精油按摩中文字幕久久| 99久久精品国产导航| 欧美日韩一区二区在线观看视频 | 亚洲综合在线免费观看| 亚洲第一福利视频在线| 国产一区欧美二区| 欧美在线观看一二区| 日韩一级二级三级精品视频| 国产精品久久久久久久浪潮网站| 亚洲成人资源在线| 不卡一区二区三区四区| 制服丝袜中文字幕一区| 中文字幕一区日韩精品欧美| 婷婷开心激情综合| 成人99免费视频| 日韩午夜av一区| 亚洲国产视频a| 成人性生交大片免费看在线播放| 欧美日韩国产成人在线91| 国产欧美一区二区在线观看| 日本不卡在线视频| 色呦呦国产精品| 国产欧美日韩另类视频免费观看| 日韩国产在线一| 91国偷自产一区二区开放时间| 精品三级在线观看| 香蕉成人啪国产精品视频综合网 | 天天操天天色综合| 成人激情视频网站| 欧美电影免费观看高清完整版在| 亚洲狠狠丁香婷婷综合久久久| 国产精品影视在线观看| 欧美一区二区日韩| 亚洲国产sm捆绑调教视频| 91欧美激情一区二区三区成人| 久久一二三国产| 久久精品国产99久久6| 欧美老女人第四色| 亚洲一区二区在线观看视频| 99久久99久久精品国产片果冻| 久久久影院官网| 国内精品写真在线观看| 欧美zozozo| 乱中年女人伦av一区二区| 日韩美一区二区三区| 日产精品久久久久久久性色| 欧美日本一区二区| 视频一区国产视频| 3d成人h动漫网站入口| 日韩国产精品久久久久久亚洲| 欧美日韩一区二区欧美激情| 一区二区三区中文字幕精品精品| 91网站在线播放| 一区二区不卡在线播放| 欧美少妇xxx| 免费看黄色91| 久久影院电视剧免费观看| 国产综合一区二区| 日本一区二区免费在线| av激情亚洲男人天堂| 亚洲人123区| 欧美日韩情趣电影| 老司机免费视频一区二区三区| 精品欧美一区二区三区精品久久| 丝袜诱惑亚洲看片| www久久精品| 成人午夜电影网站| 一区二区免费看| 欧美一区二区三区视频免费| 国产真实乱子伦精品视频| 成人欧美一区二区三区1314| 91理论电影在线观看| 日韩精品1区2区3区| 国产清纯白嫩初高生在线观看91 | 欧美一区二区在线视频| 久久国产视频网| 中文字幕视频一区二区三区久| 欧美系列一区二区| 国产一区二区三区四| 亚洲精品videosex极品| 欧美一区二区三区四区五区| 成人午夜短视频| 日本视频中文字幕一区二区三区| 国产视频一区二区在线| 91久久国产最好的精华液| 亚洲va国产天堂va久久en| 久久久一区二区三区捆绑**| 色综合色狠狠天天综合色| 毛片一区二区三区| 亚洲六月丁香色婷婷综合久久| 欧美不卡激情三级在线观看| 99v久久综合狠狠综合久久| 日韩成人免费在线| 亚洲欧美一区二区在线观看| 日韩一区二区三区精品视频| 在线亚洲+欧美+日本专区| 日本中文字幕一区| 亚洲丝袜美腿综合| 久久综合狠狠综合| 欧美日韩国产三级| 91丨九色丨国产丨porny| 蜜桃视频第一区免费观看| 亚洲猫色日本管| 国产欧美精品在线观看| 精品久久国产老人久久综合| 色乱码一区二区三区88| 国产成人夜色高潮福利影视| 蜜臀久久99精品久久久画质超高清| 日韩一区日韩二区| 国产精品久久久久影视| 久久理论电影网| 欧美精品一区二区三区一线天视频| 欧美三区在线观看| 99久久精品国产一区| 成人免费高清视频在线观看| 韩国av一区二区三区| 免费欧美在线视频| 日本系列欧美系列| 日韩精品福利网| 蜜桃av噜噜一区| 日韩精品一二区| 麻豆精品在线观看| 奇米综合一区二区三区精品视频| 亚洲大片精品永久免费| 亚洲一二三四区| 亚洲地区一二三色| 爽好多水快深点欧美视频| 亚洲不卡在线观看| 日韩电影在线一区二区三区| 婷婷六月综合网| 另类人妖一区二区av| 国内外精品视频| 不卡一区中文字幕| 99国产精品一区| 欧美综合欧美视频| 51精品国自产在线| 久久久久久麻豆| 国产精品久久久久久亚洲毛片| 欧美国产精品v| 亚洲精品国产一区二区三区四区在线 | 99re亚洲国产精品| 色av成人天堂桃色av| 欧美日韩精品免费| 欧美大片日本大片免费观看| 337p日本欧洲亚洲大胆色噜噜| 国产无人区一区二区三区| 国产精品午夜在线观看| 一区二区三区四区激情| 日韩国产精品久久久久久亚洲| 精品一区二区国语对白| 成人久久久精品乱码一区二区三区| 91麻豆国产自产在线观看| 91精品啪在线观看国产60岁| 久久久久久久久久久黄色| 中文字幕日韩一区二区| 国产一区二区网址| 99久免费精品视频在线观看| 欧美日韩不卡在线| 久久精品男人的天堂| 亚洲一区二区三区四区中文字幕| 喷水一区二区三区| 福利电影一区二区| 欧美日韩一级黄| 国产精品网友自拍| 日韩高清不卡一区| 97精品久久久午夜一区二区三区| 欧美精品一二三| 综合久久久久久久| 激情偷乱视频一区二区三区| 91国产视频在线观看| 欧美r级电影在线观看| 一区二区欧美视频| 成人综合激情网| 欧美成人精品二区三区99精品| 中文字幕亚洲电影|