📄 uppercaseimpl.java
字号:
package td1;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
/**
*
*/
public class UpperCaseImpl extends UnicastRemoteObject implements UpperCase {
protected UpperCaseImpl() throws RemoteException {
}
public static void main(String[] args) {
try {
if (args.length < 1) {
System.out.println(
"Vous devez sp閏ifier le nom du Serveur en argument");
System.exit(1);
}
UpperCaseImpl server = new UpperCaseImpl();
Naming.rebind("rmi://localhost/"+args[0], server);
System.out.println("UpperCaseImpl enregister dans le registre a l'URL ");
System.out.println("rmi://localhost/"+args[0]);
} catch (RemoteException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
public String toUpperCase(String aString) throws RemoteException {
return aString.toUpperCase();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -