uppercaseimpl.java

来自「this java program」· Java 代码 · 共 56 行

JAVA
56
字号
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 + =
减小字号Ctrl + -
显示快捷键?