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


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

in Table To:


© 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