Basic HTML version of Foils prepared Aug 14 1997

Foil 55 Example: Main Client Program

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. by Geoffrey C. Fox, Wojtek Furmanski


package Counter;
class CountClient {
static public void main(String[] args) {
try {
CORBA.ORB orb = CORBA.ORB.init(); // Initialize the ORB
// binding by name to the Counter instance on the server
Counter.Count counter = Counter.Count_var.bind("My Count");
counter.sum(0); // initialize counter to zero
long startTime = System.currentTimeMillis();
for(int j=0; j򒮨 j++) { // now increment 1000 times by
counter.increment(); // calling increment() method on server object
}
long stopTime = System.currentTimeMillis();
System.out.println((stopTime-startTime)/1000f);
} catch(CORBA.Exception e) { System.err.println(e); }
}}
Note: This code is created by the developer
This becomes general hierarchical address for arbitrary server



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Jan 8 1998