Java??RMI??????
???????????? ???????[ 2014/6/6 11:38:16 ] ????????Java RMI??????
????Java?????????????Java RMI??Java Remote Method Invocation????Java???????????????????????????????ó?????????????????????е???????????????????????????????????????Java??????????????繃???з????????RMI???????????????????????????á?
????Java RMI?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface RmiTestInterface extends Remote{
public String getTest() throws RemoteException;
}
|
????????????
import java.rmi.RemoteException;
public class RmiTestImpl implements RmiTestInterface {
public RmiTestImpl() throws RemoteException {
//super();
// TODO Auto-generated constructor stub
//UnicastRemoteObject.exportObject(this);
}
/**
*
*/
public String getTest() throws RemoteException {
// TODO Auto-generated method stub
return "Hello??Test";
}
}
|
???????????main??????????????????RMI????????????????
public static void main(String []args) throws AlreadyBoundException?? RemoteException{
RmiTestImpl t=new RmiTestImpl();
RmiTestInterface tt=(RmiTestInterface)UnicastRemoteObject.exportObject(t??0);
// Bind the remote object's stub in the registry
Registry registry = LocateRegistry.createRegistry(2001);
registry.rebind("test"?? tt);
System.out.println("server is start");
}
|
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11