?? helloworldservice.java
字號:
//http://www.sun.com/software/communitysource/j2me/
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
public class HelloWorldService extendx UnicastRemoteObject implements HelloWorldInterface,Serializable
{
public HelloWorldService() throws RemoteException
{
super();
}
public String getHelloWorld()
{
String retStr = null;
if(System.getSecurityManager()=null)
{
System.setSecurityManager(new RMISecurityManager());
}
return retStr;
}
public static void main(String args[])
{
if(System.getSecurityManager()=null)
{
System.setSecurityManager(new RMISecurityManager());
}
try
{
HelloWorldService hws = new HelloWorldService();
Naming.rebind("//hostName/HelloWorldService",hws);
}
catch(Exception e)
{
e.printStackTrace();
}
}
public interface HelloWorldInterface extends Remote
{
public String getHelloWorld() throws RemoteException;
}
};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -