1 package demo.outparam; 2 3 9 10 public class serverImpl 11 extends MyServerPOA 12 { 13 14 public void op1(java.lang.String a1, 15 stringSeqHolder s) 16 { 17 String result [] = new String [5]; 18 for( int j = 0; j < 5; j++ ) 19 result[j] = a1; 20 s.value = result; 21 } 22 23 public void op2(MyServerHolder s) 24 { 25 s.value = _this(); 26 } 27 28 public void op3(my_structHolder m) 29 { 30 m.value = new my_struct("hallo", 4711, null); 31 } 32 33 public void op4(stringArrayHolder sah) 34 { 35 String s[] = new String [5]; 36 for( int i = 0; i < 5; s[i++]= "***"); 37 sah.value = s; 38 } 39 40 public String op5( org.omg.CORBA.StringHolder ws) 41 { 42 ws.value = "1234567890"; 43 return "op5 done."; 44 } 45 46 public void print(String s) 47 { 48 System.out.println(s); 49 } 50 51 public void stringCubeInOut(stringCubeHolder sc) 52 { 53 String [][][] string_cube = sc.value; 54 55 for( int outer = 0; outer < string_cube.length; outer++ ) 56 { 57 for( int middle = 0; middle < string_cube[outer].length; middle++ ) 58 { 59 for( int inner = 0; inner < string_cube[outer][middle].length; inner++ ) 60 { 61 System.out.print("StringCube ["+outer+"]["+middle+"]["+inner+"]: "); 62 System.out.println(string_cube[outer][middle][inner]); 63 string_cube[outer][middle][inner] = "Returned element ["+outer+"]["+middle+"]["+inner+"]"; 64 } 65 } 66 } 67 68 } 69 70 public boolean addNums(double n1, double n2, org.omg.CORBA.DoubleHolder n3) 71 { 72 n3.value = n1 + n2; 73 return true; 74 } 75 } 76 77 78 | Popular Tags |