View Javadoc

1   package test.crispy.example.service.corba;
2   
3   
4   /**
5   * test/crispy/example/service/corba/EchoPOA.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 EchoPOA extends org.omg.PortableServer.Servant
12   implements test.crispy.example.service.corba.EchoOperations, 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 ("ping", new java.lang.Integer (0));
21      _methods.put ("echo", new java.lang.Integer (1));
22      _methods.put ("rename", new java.lang.Integer (2));
23    }
24  
25    public org.omg.CORBA.portable.OutputStream _invoke (String $method,
26                                  org.omg.CORBA.portable.InputStream in,
27                                  org.omg.CORBA.portable.ResponseHandler $rh)
28    {
29      org.omg.CORBA.portable.OutputStream out = null;
30      java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
31      if (__method == null)
32        throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
33  
34      switch (__method.intValue ())
35      {
36         case 0:  // test/crispy/example/service/corba/Echo/ping
37         {
38           String $result = null;
39           $result = this.ping ();
40           out = $rh.createReply();
41           out.write_string ($result);
42           break;
43         }
44  
45         case 1:  // test/crispy/example/service/corba/Echo/echo
46         {
47           String pvEchoStr = in.read_string ();
48           String $result = null;
49           $result = this.echo (pvEchoStr);
50           out = $rh.createReply();
51           out.write_string ($result);
52           break;
53         }
54  
55         case 2:  // test/crispy/example/service/corba/Echo/rename
56         {
57           test.crispy.example.service.corba.Customer customer = test.crispy.example.service.corba.CustomerHelper.read (in);
58           String newLastName = in.read_string ();
59           test.crispy.example.service.corba.Customer $result = null;
60           $result = this.rename (customer, newLastName);
61           out = $rh.createReply();
62           test.crispy.example.service.corba.CustomerHelper.write (out, $result);
63           break;
64         }
65  
66         default:
67           throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
68      }
69  
70      return out;
71    } // _invoke
72  
73    // Type-specific CORBA::Object operations
74    private static String[] __ids = {
75      "IDL:test/crispy/example/service/corba/Echo:1.0"};
76  
77    public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
78    {
79      return (String[])__ids.clone ();
80    }
81  
82    public Echo _this() 
83    {
84      return EchoHelper.narrow(
85      super._this_object());
86    }
87  
88    public Echo _this(org.omg.CORBA.ORB orb) 
89    {
90      return EchoHelper.narrow(
91      super._this_object(orb));
92    }
93  
94  
95  } // class EchoPOA