| /* |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| * this work for additional information regarding copyright ownership. |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| * (the "License"); you may not use this file except in compliance with |
| * the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| package test.codesets; |
| |
| // |
| // IDL:TestCodeSets:1.0 |
| // |
| public abstract class TestCodeSetsPOA |
| extends org.omg.PortableServer.Servant |
| implements org.omg.CORBA.portable.InvokeHandler, |
| TestCodeSetsOperations |
| { |
| static final String[] _ob_ids_ = |
| { |
| "IDL:TestCodeSets:1.0", |
| }; |
| |
| public TestCodeSets |
| _this() |
| { |
| return TestCodeSetsHelper.narrow(super._this_object()); |
| } |
| |
| public TestCodeSets |
| _this(org.omg.CORBA.ORB orb) |
| { |
| return TestCodeSetsHelper.narrow(super._this_object(orb)); |
| } |
| |
| public String[] |
| _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectId) |
| { |
| return _ob_ids_; |
| } |
| |
| public org.omg.CORBA.portable.OutputStream |
| _invoke(String opName, |
| org.omg.CORBA.portable.InputStream in, |
| org.omg.CORBA.portable.ResponseHandler handler) |
| { |
| final String[] _ob_names = |
| { |
| "deactivate", |
| "testChar", |
| "testString", |
| "testWChar", |
| "testWString" |
| }; |
| |
| int _ob_left = 0; |
| int _ob_right = _ob_names.length; |
| int _ob_index = -1; |
| |
| while(_ob_left < _ob_right) |
| { |
| int _ob_m = (_ob_left + _ob_right) / 2; |
| int _ob_res = _ob_names[_ob_m].compareTo(opName); |
| if(_ob_res == 0) |
| { |
| _ob_index = _ob_m; |
| break; |
| } |
| else if(_ob_res > 0) |
| _ob_right = _ob_m; |
| else |
| _ob_left = _ob_m + 1; |
| } |
| |
| if(_ob_index == -1 && opName.charAt(0) == '_') |
| { |
| _ob_left = 0; |
| _ob_right = _ob_names.length; |
| String _ob_ami_op = |
| opName.substring(1); |
| |
| while(_ob_left < _ob_right) |
| { |
| int _ob_m = (_ob_left + _ob_right) / 2; |
| int _ob_res = _ob_names[_ob_m].compareTo(_ob_ami_op); |
| if(_ob_res == 0) |
| { |
| _ob_index = _ob_m; |
| break; |
| } |
| else if(_ob_res > 0) |
| _ob_right = _ob_m; |
| else |
| _ob_left = _ob_m + 1; |
| } |
| } |
| |
| switch(_ob_index) |
| { |
| case 0: // deactivate |
| return _OB_op_deactivate(in, handler); |
| |
| case 1: // testChar |
| return _OB_op_testChar(in, handler); |
| |
| case 2: // testString |
| return _OB_op_testString(in, handler); |
| |
| case 3: // testWChar |
| return _OB_op_testWChar(in, handler); |
| |
| case 4: // testWString |
| return _OB_op_testWString(in, handler); |
| } |
| |
| throw new org.omg.CORBA.BAD_OPERATION(); |
| } |
| |
| private org.omg.CORBA.portable.OutputStream |
| _OB_op_deactivate(org.omg.CORBA.portable.InputStream in, |
| org.omg.CORBA.portable.ResponseHandler handler) |
| { |
| org.omg.CORBA.portable.OutputStream out = null; |
| deactivate(); |
| out = handler.createReply(); |
| return out; |
| } |
| |
| private org.omg.CORBA.portable.OutputStream |
| _OB_op_testChar(org.omg.CORBA.portable.InputStream in, |
| org.omg.CORBA.portable.ResponseHandler handler) |
| { |
| org.omg.CORBA.portable.OutputStream out = null; |
| char _ob_a0 = in.read_char(); |
| char _ob_r = testChar(_ob_a0); |
| out = handler.createReply(); |
| out.write_char(_ob_r); |
| return out; |
| } |
| |
| private org.omg.CORBA.portable.OutputStream |
| _OB_op_testString(org.omg.CORBA.portable.InputStream in, |
| org.omg.CORBA.portable.ResponseHandler handler) |
| { |
| org.omg.CORBA.portable.OutputStream out = null; |
| String _ob_a0 = in.read_string(); |
| String _ob_r = testString(_ob_a0); |
| out = handler.createReply(); |
| out.write_string(_ob_r); |
| return out; |
| } |
| |
| private org.omg.CORBA.portable.OutputStream |
| _OB_op_testWChar(org.omg.CORBA.portable.InputStream in, |
| org.omg.CORBA.portable.ResponseHandler handler) |
| { |
| org.omg.CORBA.portable.OutputStream out = null; |
| char _ob_a0 = in.read_wchar(); |
| char _ob_r = testWChar(_ob_a0); |
| out = handler.createReply(); |
| out.write_wchar(_ob_r); |
| return out; |
| } |
| |
| private org.omg.CORBA.portable.OutputStream |
| _OB_op_testWString(org.omg.CORBA.portable.InputStream in, |
| org.omg.CORBA.portable.ResponseHandler handler) |
| { |
| org.omg.CORBA.portable.OutputStream out = null; |
| String _ob_a0 = in.read_wstring(); |
| String _ob_r = testWString(_ob_a0); |
| out = handler.createReply(); |
| out.write_wstring(_ob_r); |
| return out; |
| } |
| } |