⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 remserver.java

📁 有关java的源程序,为讲授java程序设计课程使用
💻 JAVA
字号:
import java.rmi.*;
import java.net.*;
public class RemServer
{
	public static void main(String[] args)
	{
/*
	Create and install a security manager,The main method of the server 
	first needs to create and install a security manager;
	either the RMISecurityManager or one that you have defined yourself. 

	A security manager needs to be running so that it can guarantee that 
	the classes that get loaded do not perform operations that they are 
	not allowed to perform. If no security manager is specified no class
	loading, by RMI clients or servers, is allowed, aside from what can 
	be found in the local CLASSPATH.
*/
/*
        if (System.getSecurityManager() == null) 
		   {
               System.setSecurityManager(new RMISecurityManager());
           }
*/
	     try
	     {
/*
   The main method of the server needs to create one or more instances 
   of the remote object implementation which provides the service. 
*/
		RemImpl localObject=new RemImpl();
/*
    For bootstrapping, the RMI system provides a remote object registry
	that allows you to bind a URL-formatted name of the form 
	"//host/objectname" to the remote object, where objectname is a simple 
	string name.For example, the following code binds the name "Rem" to a 
	reference for the remote object.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -