View Javadoc

1   package test.crispy.example.service.corba;
2   
3   
4   /**
5   * test/crispy/example/service/corba/CalculatorPOA.java .
6   * Generated by the IDL-to-Java compiler (portable), version "3.2"
7   * from Echo.idl
8   * Donnerstag, 13. April 2006 19.25 Uhr CEST
9   */
10  
11  public abstract class CalculatorPOA extends org.omg.PortableServer.Servant
12   implements test.crispy.example.service.corba.CalculatorOperations, org.omg.CORBA.portable.InvokeHandler
13  {
14  
15    // Constructors
16  
17    private static java.util.Hashtable _methods = new java.util.Hashtable ();
18    static
19    {
20      _methods.put ("add", new java.lang.Integer (0));
21      _methods.put ("subtract", new java.lang.Integer (1));
22    }
23  
24    public org.omg.CORBA.portable.OutputStream _invoke (String $method,
25                                  org.omg.CORBA.portable.InputStream in,
26                                  org.omg.CORBA.portable.ResponseHandler $rh)
27    {
28      org.omg.CORBA.portable.OutputStream out = null;
29      java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
30      if (__method == null)
31        throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
32  
33      switch (__method.intValue ())
34      {
35         case 0:  // test/crispy/example/service/corba/Calculator/add
36         {
37           int a = in.read_long ();
38           int b = in.read_long ();
39           int $result = (int)0;
40           $result = this.add (a, b);
41           out = $rh.createReply();
42           out.write_long ($result);
43           break;
44         }
45  
46         case 1:  // test/crispy/example/service/corba/Calculator/subtract
47         {
48           int a = in.read_long ();
49           int b = in.read_long ();
50           int $result = (int)0;
51           $result = this.subtract (a, b);
52           out = $rh.createReply();
53           out.write_long ($result);
54           break;
55         }
56  
57         default:
58           throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
59      }
60  
61      return out;
62    } // _invoke
63  
64    // Type-specific CORBA::Object operations
65    private static String[] __ids = {
66      "IDL:test/crispy/example/service/corba/Calculator:1.0"};
67  
68    public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
69    {
70      return (String[])__ids.clone ();
71    }
72  
73    public Calculator _this() 
74    {
75      return CalculatorHelper.narrow(
76      super._this_object());
77    }
78  
79    public Calculator _this(org.omg.CORBA.ORB orb) 
80    {
81      return CalculatorHelper.narrow(
82      super._this_object(orb));
83    }
84  
85  
86  } // class CalculatorPOA