FileDocCategorySizeDatePackage
MyClient.javaAPI DocExample1047Sat Jul 12 02:10:42 BST 1997None

MyClient

public class MyClient extends UnicastRemoteObject implements WorkListener

Fields Summary
Constructors Summary
public MyClient(String host)

		try {
			Server server = (Server)Naming.lookup("//"+host+"/NiftyServer");

			System.out.println( server.getDate() );
			System.out.println( server.execute( new MyCalculation(2) ) );
			StringEnumeration se = server.getList();
			while ( se.hasMoreItems() )
				System.out.println( se.nextItem() );
			server.asyncExecute( new MyCalculation(100), this );

		} catch (java.io.IOException e) { 
			// I/O Error or bad URL
System.out.println(e);
		} catch (NotBoundException e) { 
			// NiftyServer isn't registered
System.out.println(e);
		}
    
Methods Summary
public static voidmain(java.lang.String[] args)

		System.setSecurityManager(new RMISecurityManager());
		new MyClient( args[0] );
	
public voidworkCompleted(WorkRequest request, java.lang.Object result)

		System.out.println("Async work result = " + result);
		System.out.flush();