服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > JAVA > 新手入门 > 基础入门 > 查看文档

java核心代码例程之:rmiexamplesetup.java


import java.rmi.*;
import javax.naming.*;

/**
 * this class registers rmiexampleserver with the rmi registry
 * @author renga
 **/
public class rmiexamplesetup {

/**
 * main method
 * @param args command-line arguments
 **/
public static void main( string[] args ) {
try {
// set the security manager
system.setsecuritymanager( new rmisecuritymanager() );

// create a new object of rmiexampleserver
rmiexampleserver server = new rmiexampleserver();

// bind this object with the rmi registry
naming.bind( "rmiexample", server );
} catch( exception e ) {
e.printstacktrace();
}
}
}

扫描关注微信公众号