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 |