FileDocCategorySizeDatePackage
ConvertClient.javaAPI DocExample2275Thu Mar 16 11:52:42 GMT 2000None

ConvertClient

public class ConvertClient extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        System.setSecurityManager(new RMISecurityManager());

        // Create the lookup manager to discover lookup services
        ClientLookupManager clm = new ClientLookupManager(null, null);
        Class[] name = new Class[] { ConvertService.class };
        ServiceTemplate st = new ServiceTemplate(null, name, null);
        
        // Block until a matching service is found
        ServiceItem[] si = clm.lookup(st, 1, 1, null, Long.MAX_VALUE);
        if (si == null || si.length == 0)
            throw new Exception("Can't find service");
        ConvertService cs = (ConvertService) si[0].service;

        // Now invoke methods on the service object
        System.out.println(cs.convert(5));
	clm.terminate();