File: benchsServer.java

package info (click to toggle)
polyorb 2.11~20140418-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 30,012 kB
  • ctags: 465
  • sloc: ada: 273,015; sh: 4,507; makefile: 4,265; python: 1,332; cpp: 1,213; java: 507; ansic: 274; xml: 30; perl: 23; exp: 6
file content (147 lines) | stat: -rw-r--r-- 4,504 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
//--------------------------------------------------------------------------//
//                                                                          //
//                           POLYORB COMPONENTS                             //
//                                                                          //
//                         b e n c h s S e r v e r                          //
//                                                                          //
//                                 J A V A                                  //
//                                                                          //
//           Copyright (C) 2009, Free Software Foundation, Inc.             //
//                                                                          //
// PolyORB is free software; you  can  redistribute  it and/or modify it    //
// under terms of the  GNU General Public License as published by the  Free //
// Software Foundation;  either version 2,  or (at your option)  any  later //
// version. PolyORB is distributed  in the hope that it will be  useful,    //
// but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- //
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public //
// License  for more details.  You should have received  a copy of the GNU  //
// General Public License distributed with PolyORB; see file COPYING. If    //
// not, write to the Free Software Foundation, 51 Franklin Street, Fifth    //
// Floor, Boston, MA 02111-1301, USA.                                       //
//                                                                          //
//                                                                          //
//                  PolyORB is maintained by AdaCore                        //
//                     (email: sales@adacore.com)                           //
//                                                                          //
//--------------------------------------------------------------------------//
import org.omg.CORBA.*;
import org.omg.PortableServer.*;

class benchsImpl extends benchsPOA {
  private ORB orb;
  private short data = 123;

  public void setORB (ORB orb_val) {
    orb = orb_val;
  }

  public short noParameter () {
    return data;
  }

  public void azerty () {
  }

  public boolean echoBoolean (boolean arg) {
    return arg;
  }

  public short echoShort (short arg) {
    return arg;
  }

  public int echoLong (int arg) {
    return arg;
  }

  public float echoFloat (float arg) {
    return arg;
  }

  public double echoDouble (double arg) {
    return arg;
  }

  public char echoChar (char arg) {
    return arg;
  }

  public char echoWChar (char arg) {
    return arg;
  }

  public String echoString (String arg) {
    return arg;
  }

  public String echoWstring (String arg) {
    return arg;
  }

  public benchsPackage.Color echoColor (benchsPackage.Color arg) {
    return arg;
  }

  public benchsPackage.Color[] echoRainbow (benchsPackage.Color[] arg) {
    return arg;
  }

  public benchsPackage.myUnion echoUnion (benchsPackage.myUnion arg) {
    return arg;
  }

  public benchsPackage.myUnionEnumSwitch echoUnionEnumSwitch (benchsPackage.myUnionEnumSwitch arg) {
    return arg;
  }

  public benchsPackage.simple_struct echoStruct (benchsPackage.simple_struct arg) {
    return arg;
  }

  public benchsPackage.array_struct echoArrayStruct (benchsPackage.array_struct arg) {
    return arg;
  }

  public int[][] echoSixteenKb (int[][] arg) {
    return arg;
  }

  public benchsPackage.nested_struct echoNestedStruct (benchsPackage.nested_struct arg) {
    return arg;
  }

  public short[] echoUsequence (short[] arg) {
    return arg;
  }

  public void StopServer () {
    orb.shutdown(false);
  }
}

public class benchsServer {

  public static void main (String args[]) {
    try {
      ORB orb = ORB.init (args, null);
      POA poa = POAHelper.narrow (orb.resolve_initial_references ("RootPOA"));
      poa.the_POAManager ().activate ();

      benchsImpl impl = new benchsImpl ();
      impl.setORB (orb);
      benchs ref = benchsHelper.narrow (poa.servant_to_reference (impl));

      System.out.println (orb.object_to_string (ref));
      System.out.println ("benchServer ready and waiting...");

      orb.run ();

    } catch (Exception e) {
      System.err.println ("ERROR: " + e);
      e.printStackTrace (System.out);
    }

    System.out.println ("benchServer Exiting...");
  }

}