public static void main(String[] args) {
		String serviceName = null;
		String serverIp = null;
		int serverPort  = 0;
		if (args.length != 3) {
			System.out.println("Usage: java test.test4Client <ServiceName> <ServerIp> <ServerPort>");
			return;
		} else {
			serviceName = args[0];
			serverIp = args[1];
			serverPort = Integer.parseInt(args[2]);
		}
		
		PersonInterface person = new Person();
		person.setName("Chris");
		person.setAge(25);
		
		Registry440 registryRemote = null;
		try {
			registryRemote = LocateRegistry440.getRegistry(serverIp, serverPort);
		} catch (RemoteException440 e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		SayHelloInterface sayHello = null;
		try {
			sayHello = (SayHelloInterface) registryRemote.lookup(serviceName);
		} catch (Exception e1) {
			e1.printStackTrace();
		}
		
		/* parameter is an unexported remote object, which will be passed by value */
		String newName = sayHello.resetPerson(person);
		System.out.println("Person's name on server side: " + newName);
		System.out.println("Person's name on client side: " + person.getName());
		
		System.out.println("/*------Now exported person object--------*/");
		PersonInterface personStub = null;
		try {
			personStub = (PersonInterface) UnicastRemoteObject440.exportObject(person, 0);
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (RemoteException440 e) {
			e.printStackTrace();
		}
		Registry440 registry = null;
		try {
			registry = LocateRegistry440.getRegistry("localhost", 1099);
		} catch (RemoteException440 e) {
			e.printStackTrace();
		}
		registry.rebind("PersonOnClientRegistry", personStub);
		
		/* parameter is an exported remote object, which will be passed by reference (its stub) */
		newName = sayHello.resetPerson(person);
		System.out.println("Person's name on server side: " + newName);
		System.out.println("Person's name on client side: " + person.getName());
		
		
	}