首页 > 学院 > 开发设计 > 正文

Java核心代码例程之:RMIExampleSetup.java

2019-11-18 15:16:56
字体:
来源:转载
供稿:网友

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();
}
}
}

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表