Java RMI?????????????
???????????? ???????[ 2013/1/15 10:54:19 ] ????????
????RMI???
????Java???????????RMI??????Java??????????????????????????????????????е?????????????????????????Java??????????????繃???з???????????????????Java?????????????ó???????????????????????
??????????????????? Java ?У???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????ɡ?
???????????????????
????1???????????public?????????????????????????????????????????????? ??????????????????????????????????????????
????2????????????????java.rmi.Remote??
????3????????ó???????????????????????е?????????????????????throws????? ????java.rmi.RemoteException??????RemoteException ???????
????4??????????????????????????????????????????????????????????????? ???????????????????
???????????????????????????RMI????????????????????????????HelloWorld?????????RMI????????????????
/**
* User: jiangzhenfei
* Date: 2012-8-7 21:50:02
* ???????????????????Remote????????????????????????????RemoteException??
*/
public interface IHello extends Remote {
/**
* ???????“Hello World??"????
* @return ????“Hello World??"????
* @throws java.rmi.RemoteException
*/
public String helloWorld() throws RemoteException;
/**
* ????????????????????????????????????????
* @param someBodyName ????
* @return ??????????????
* @throws java.rmi.RemoteException
*/
public String sayHelloToSomeBody(String someBodyName) throws RemoteException;
}
?????????????????
???????????????????????????java.rmi.UnicastRemoteObject?????????????????????????????????а????????????????????????????????????????????и??????????????????????????е???????????????????????????????????????????????????????幹??????????????????????????????????????????????????????????????????????java.rmi.RemoteException??????????????????????java.rmi.RemoteException????
????????????????????????????
/**
* User: jiangzhenfei
* Date: 2012-8-7 21:56:47
* ??????????
*/
public class HelloImpl extends UnicastRemoteObject implements IHello {
/**
* ???UnicastRemoteObject????????????RemoteException????????????????????????д?????????????RemoteException??
*
* @throws RemoteException
*/
public HelloImpl() throws RemoteException {
}
/**
* ???????“Hello World??"????
*
* @return ????“Hello World??"????
* @throws java.rmi.RemoteException
*/
public String helloWorld() throws RemoteException {
return "Hello World!";
}
/**
* ????????????????????????????????????????
*
* @param someBodyName ????
* @return ??????????????
* @throws java.rmi.RemoteException
*/
public String sayHelloToSomeBody(String someBodyName) throws RemoteException {
return "????" + someBodyName + "!";
}
}
??????
???·???
??????????????????
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