package edu.ucsb.cs.jicos.examples.nfibonacci; import edu.ucsb.cs.jicos.examples.fastfibonacci.*; import edu.ucsb.cs.jicos.services.*; import java.rmi.*; final class Application { public static void main ( String args[] ) throws Exception { // set hspDomainName to the domain name of a machine running an Hsp String hspDomainName = args[0]; // get a reference to a Hosting Service Provider HspAgent agent = new HspAgent( hspDomainName ); Client2Hsp hsp = agent.getClient2Hsp(); // login Environment environment = new Environment( null, null ); hsp.login( environment ); // compute f( n, m ) = f(f( ... f(m)) ... ), where composition occurs n times int n = Integer.parseInt( args[1] ); int m = Integer.parseInt( args[2] ); for ( int i = 1, k = m; i <= n; i++ ) { Task task = new F( k ); Integer fnm = (Integer) hsp.compute( task ); k = fnm.intValue(); System.out.println("F( " + i + ", " + m + " ) = " + k ); } hsp.logout(); } }