r2corba 1.5.4 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +2 -1
  3. data/ext/extload/extload.c +5 -6
  4. data/ext/libr2tao/object.cpp +4 -4
  5. data/ext/libr2tao/orb.cpp +8 -8
  6. data/ext/libr2tao/r2tao_ext.h +0 -12
  7. data/ext/libr2tao/required.cpp +2 -2
  8. data/ext/libr2tao/required.h +9 -11
  9. data/ext/libr2tao/values.cpp +5 -5
  10. data/ext/libr2tao/values.h +19 -19
  11. data/ext/librpoa/iortable.cpp +3 -3
  12. data/ext/librpoa/poa.cpp +7 -7
  13. data/ext/librpoa/servant.cpp +15 -90
  14. data/ext/librpoa/servant.h +13 -35
  15. data/lib/corba/cbase/ORB.rb +7 -7
  16. data/lib/corba/cbase/Streams.rb +2 -2
  17. data/lib/corba/cbase/Typecode.rb +6 -6
  18. data/lib/corba/cbase/exception.rb +2 -2
  19. data/lib/corba/cbase/policies.rb +1 -1
  20. data/lib/corba/cmds/base.rb +1 -1
  21. data/lib/corba/common/Any.rb +1 -1
  22. data/lib/corba/common/ORB.rb +1 -1
  23. data/lib/corba/common/Object.rb +0 -1
  24. data/lib/corba/common/Stub.rb +1 -1
  25. data/lib/corba/common/Typecode.rb +34 -34
  26. data/lib/corba/common/const.rb +2 -2
  27. data/lib/corba/common/version.rb +1 -1
  28. data/lib/corba/jbase/Any.rb +23 -23
  29. data/lib/corba/jbase/ORB.rb +3 -3
  30. data/lib/corba/jbase/Request.rb +5 -5
  31. data/lib/corba/jbase/Servant.rb +10 -10
  32. data/lib/corba/jbase/ServerRequest.rb +7 -7
  33. data/lib/corba/jbase/Streams.rb +3 -3
  34. data/lib/corba/jbase/Typecode.rb +14 -14
  35. data/lib/corba/jbase/exception.rb +1 -1
  36. data/lib/corba/jbase/poa.rb +2 -2
  37. data/lib/corba/jbase/policies.rb +3 -3
  38. data/lib/corba/poa.rb +1 -1
  39. data/lib/corba/policies.rb +1 -1
  40. data/lib/corba/require.rb +2 -2
  41. data/lib/corba/svcs/ins/cos_naming.rb +27 -27
  42. data/lib/corba/svcs/ins/ins.rb +17 -17
  43. data/lib/corba/svcs/ins/naming_service.rb +2 -2
  44. data/lib/ridlbe/ruby/config.rb +10 -10
  45. data/lib/ridlbe/ruby/walker.rb +21 -21
  46. data/mkrf_conf_srcgem.rb +5 -5
  47. data/rakelib/bin.rake +1 -1
  48. data/rakelib/bin.rb +3 -3
  49. data/rakelib/build.rake +15 -15
  50. data/rakelib/config.rb +13 -13
  51. data/rakelib/ext.rake +3 -5
  52. data/rakelib/ext.rb +13 -13
  53. data/rakelib/ext_r2tao.rb +12 -18
  54. data/rakelib/gem.rake +5 -5
  55. data/rakelib/gem.rb +5 -5
  56. data/test/BiDirectional/client.rb +3 -3
  57. data/test/BiDirectional/run_test.rb +1 -1
  58. data/test/BiDirectional/server.rb +4 -5
  59. data/test/CORBA_Services/Naming/BindingIterator/client.rb +5 -5
  60. data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +1 -1
  61. data/test/CORBA_Services/Naming/BindingIterator/server.rb +4 -4
  62. data/test/CORBA_Services/Naming/Corbaname/client.rb +3 -3
  63. data/test/CORBA_Services/Naming/Corbaname/run_test.rb +1 -1
  64. data/test/CORBA_Services/Naming/Corbaname/server.rb +10 -10
  65. data/test/CORBA_Services/Naming/Simple/client.rb +4 -4
  66. data/test/CORBA_Services/Naming/Simple/run_test.rb +1 -1
  67. data/test/CORBA_Services/Naming/Simple/server.rb +4 -4
  68. data/test/Collocation/test.rb +2 -2
  69. data/test/Connect_Timeout/client.rb +3 -4
  70. data/test/DII/client.rb +5 -5
  71. data/test/DII/run_test.rb +1 -1
  72. data/test/DII/server.rb +3 -3
  73. data/test/DSI/client.rb +3 -3
  74. data/test/DSI/run_test.rb +1 -1
  75. data/test/DSI/server.rb +3 -3
  76. data/test/Exceptions/client.rb +4 -4
  77. data/test/Exceptions/run_test.rb +1 -1
  78. data/test/Exceptions/server.rb +3 -3
  79. data/test/Hello/client.rb +3 -3
  80. data/test/Hello/run_test.rb +1 -1
  81. data/test/Hello/server.rb +3 -3
  82. data/test/IDL_Test/client.rb +3 -3
  83. data/test/IDL_Test/run_test.rb +1 -1
  84. data/test/IDL_Test/server.rb +3 -3
  85. data/test/IORMap/client.rb +3 -3
  86. data/test/IORMap/run_test.rb +1 -1
  87. data/test/IORMap/server.rb +4 -4
  88. data/test/IORTable/client.rb +3 -3
  89. data/test/IORTable/run_test.rb +1 -1
  90. data/test/IORTable/server.rb +4 -4
  91. data/test/Implicit_Conversion/client.rb +4 -4
  92. data/test/Implicit_Conversion/run_test.rb +1 -1
  93. data/test/Implicit_Conversion/server.rb +3 -3
  94. data/test/Multi_Threading/Multiple_ORB/client.rb +3 -3
  95. data/test/Multi_Threading/Multiple_ORB/run_test.rb +2 -2
  96. data/test/Multi_Threading/Multiple_ORB/server.rb +3 -3
  97. data/test/Multi_Threading/Simple/client.rb +4 -4
  98. data/test/Multi_Threading/Simple/run_test.rb +1 -1
  99. data/test/Multi_Threading/Simple/server.rb +3 -3
  100. data/test/Multi_Threading/Threads/client.rb +3 -3
  101. data/test/Multi_Threading/Threads/run_test.rb +1 -1
  102. data/test/Multi_Threading/Threads/server.rb +4 -4
  103. data/test/Multi_Threading/Threads/watchdog.rb +3 -3
  104. data/test/Multiple_Servant_Interfaces/client.rb +3 -3
  105. data/test/Multiple_Servant_Interfaces/run_test.rb +1 -1
  106. data/test/Multiple_Servant_Interfaces/server.rb +3 -3
  107. data/test/Nil/test.rb +3 -4
  108. data/test/OBV/AbstractInterface/client.rb +3 -3
  109. data/test/OBV/AbstractInterface/run_test.rb +1 -1
  110. data/test/OBV/AbstractInterface/server.rb +3 -3
  111. data/test/OBV/Custom/client.rb +3 -3
  112. data/test/OBV/Custom/run_test.rb +1 -1
  113. data/test/OBV/Custom/server.rb +3 -3
  114. data/test/OBV/Simple/client.rb +3 -3
  115. data/test/OBV/Simple/run_test.rb +1 -1
  116. data/test/OBV/Simple/server.rb +3 -3
  117. data/test/OBV/Simple_Event/client.rb +3 -3
  118. data/test/OBV/Simple_Event/run_test.rb +1 -1
  119. data/test/OBV/Simple_Event/server.rb +3 -3
  120. data/test/OBV/Supports/client.rb +3 -3
  121. data/test/OBV/Supports/run_test.rb +1 -1
  122. data/test/OBV/Supports/server.rb +3 -3
  123. data/test/OBV/Tree/client.rb +3 -3
  124. data/test/OBV/Tree/run_test.rb +1 -1
  125. data/test/OBV/Tree/server.rb +3 -3
  126. data/test/OBV/Truncatable/Truncatable_impl.rb +1 -1
  127. data/test/OBV/Truncatable/client.rb +4 -4
  128. data/test/OBV/Truncatable/run_test.rb +1 -1
  129. data/test/OBV/Truncatable/server.rb +3 -3
  130. data/test/OBV/ValueBox/client.rb +44 -44
  131. data/test/OBV/ValueBox/run_test.rb +1 -1
  132. data/test/OBV/ValueBox/server.rb +29 -29
  133. data/test/Object/client.rb +4 -4
  134. data/test/Object/run_test.rb +1 -1
  135. data/test/Object/server.rb +3 -3
  136. data/test/POA/test.rb +3 -3
  137. data/test/Param_Test/client.rb +6 -6
  138. data/test/Param_Test/run_test.rb +1 -1
  139. data/test/Param_Test/server.rb +6 -6
  140. data/test/Performance/Simple/client.rb +3 -3
  141. data/test/Performance/Simple/run_test.rb +1 -1
  142. data/test/Performance/Simple/server.rb +3 -3
  143. data/test/Policies/test.rb +2 -3
  144. data/test/Timeout/client.rb +6 -6
  145. data/test/Timeout/run_test.rb +1 -1
  146. data/test/Timeout/server.rb +4 -4
  147. data/test/lib/assert.rb +0 -1
  148. data/test/lib/test.rb +14 -15
  149. data/test/test_runner.rb +5 -6
  150. metadata +4 -6
  151. data/ext/librpoa/srvreq_fix.cpp +0 -282
  152. data/ext/librpoa/srvreq_fix.h +0 -148
data/test/lib/assert.rb CHANGED
@@ -39,4 +39,3 @@ module TestUtil
39
39
  end
40
40
 
41
41
  end
42
-
data/test/lib/test.rb CHANGED
@@ -65,7 +65,7 @@ if defined?(JRUBY_VERSION)
65
65
  # const char *const *argv,
66
66
  # const char *const *envp);
67
67
 
68
- attach_function :_spawnvpe,:_spawnvpe, [:int, :string, :pointer, :pointer], :pointer
68
+ attach_function :_spawnvpe, :_spawnvpe, [:int, :string, :pointer, :pointer], :pointer
69
69
 
70
70
  P_NOWAIT = 1
71
71
 
@@ -105,7 +105,7 @@ if defined?(JRUBY_VERSION)
105
105
  def self.wait(pid)
106
106
  stat_ptr = FFI::MemoryPointer.new(:int, 1)
107
107
  tmp_pid = _wait(stat_ptr, pid, 0)
108
- if tmp_pid==pid
108
+ if tmp_pid == pid
109
109
  return [pid, stat_ptr.get_int()]
110
110
  else
111
111
  return [pid, 0]
@@ -120,7 +120,7 @@ if defined?(JRUBY_VERSION)
120
120
  args_ary.put_array_of_pointer(0, str_ptrs)
121
121
 
122
122
  env_ary = FFI::MemoryPointer.new(:pointer, ENV.length + 1)
123
- env_ptrs = ENV.map {|key,value| FFI::MemoryPointer.from_string("#{key}=#{value}")}
123
+ env_ptrs = ENV.map {|key, value| FFI::MemoryPointer.from_string("#{key}=#{value}")}
124
124
  env_ary.put_array_of_pointer(0, env_ptrs)
125
125
 
126
126
  [P_NOWAIT, args[0], args_ary, env_ary]
@@ -159,7 +159,7 @@ if defined?(JRUBY_VERSION)
159
159
  def self.wait(pid)
160
160
  begin
161
161
  tmp, status = ::Process.waitpid2(pid, ::Process::WNOHANG)
162
- if tmp==pid and status.success? != nil
162
+ if tmp == pid and status.success? != nil
163
163
  return [pid, status.success?() ? 0 : status.exitstatus ]
164
164
  end
165
165
  return [nil, 0]
@@ -178,7 +178,7 @@ if defined?(JRUBY_VERSION)
178
178
  args_ary.put_array_of_pointer(0, str_ptrs)
179
179
 
180
180
  env_ary = FFI::MemoryPointer.new(:pointer, ENV.length + 1)
181
- env_ptrs = ENV.map {|key,value| FFI::MemoryPointer.from_string("#{key}=#{value}")}
181
+ env_ptrs = ENV.map {|key, value| FFI::MemoryPointer.from_string("#{key}=#{value}")}
182
182
  env_ary.put_array_of_pointer(0, env_ptrs)
183
183
 
184
184
  [pid_ptr, args[0], nil, nil, args_ary, env_ary]
@@ -197,7 +197,7 @@ if defined?(JRUBY_VERSION)
197
197
  sleep 0.01
198
198
 
199
199
  tmp_pid, tmp_status = Exec.wait(@pid)
200
- if tmp_pid==@pid
200
+ if tmp_pid == @pid
201
201
  exit_status = tmp_status
202
202
  is_running = false
203
203
  end
@@ -237,7 +237,7 @@ if defined?(JRUBY_VERSION)
237
237
  end
238
238
 
239
239
  def is_running?; @exitstatus.nil?; end
240
- def has_error? ; @trd.status.nil? or (!self.is_running? and self.exitstatus!=0) ;end
240
+ def has_error? ; @trd.status.nil? or (!self.is_running? and self.exitstatus != 0) ;end
241
241
 
242
242
  def stop
243
243
  Exec.stop(@pid)
@@ -287,9 +287,9 @@ elsif is_win32? && TestUtil::RBVersion[0] < 2 && TestUtil::RBVersion[1] < 9
287
287
  extend WinAPI
288
288
 
289
289
  def Process.create(cmd_)
290
- startinfo = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
290
+ startinfo = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
291
291
  startinfo = startinfo.pack('LLLLLLLLLLLLSSLLLL')
292
- procinfo = [0,0,0,0].pack('LLLL')
292
+ procinfo = [0, 0, 0, 0].pack('LLLL')
293
293
 
294
294
  bool = CreateProcess(
295
295
  0, # App name
@@ -309,10 +309,10 @@ elsif is_win32? && TestUtil::RBVersion[0] < 2 && TestUtil::RBVersion[1] < 9
309
309
  end
310
310
 
311
311
  ProcessInfo.new(
312
- procinfo[0,4].unpack('L').first, # hProcess
313
- procinfo[4,4].unpack('L').first, # hThread
314
- procinfo[8,4].unpack('L').first, # hProcessId
315
- procinfo[12,4].unpack('L').first # hThreadId
312
+ procinfo[0, 4].unpack('L').first, # hProcess
313
+ procinfo[4, 4].unpack('L').first, # hThread
314
+ procinfo[8, 4].unpack('L').first, # hProcessId
315
+ procinfo[12, 4].unpack('L').first # hThreadId
316
316
  )
317
317
  end
318
318
 
@@ -441,7 +441,7 @@ else # !win32
441
441
  def check_status
442
442
  begin
443
443
  tmp, @status = ::Process.waitpid2(@pid, ::Process::WNOHANG)
444
- if tmp==@pid and @status.success? == false
444
+ if tmp == @pid and @status.success? == false
445
445
  @exitstatus = @status.exitstatus
446
446
  return false
447
447
  end
@@ -538,4 +538,3 @@ end
538
538
  end
539
539
 
540
540
  end
541
-
data/test/test_runner.rb CHANGED
@@ -49,23 +49,23 @@ else
49
49
  ENV['RUBYLIB'] = incdirs.join(File::PATH_SEPARATOR)
50
50
  if is_win32
51
51
  ENV['PATH'] = [
52
- File.directory?(ace_root) ? File.join(ENV['ACE_ROOT'],'lib') : nil,
52
+ File.directory?(ace_root) ? File.join(ENV['ACE_ROOT'], 'lib') : nil,
53
53
  File.expand_path(File.join(root_path, 'ext')),
54
54
  ENV['PATH']
55
55
  ].compact.join(File::PATH_SEPARATOR)
56
56
  elsif RUBY_PLATFORM =~ /darwin/
57
57
  ENV['DYLD_LIBRARY_PATH'] = [
58
- File.directory?(ace_root) ? File.join(ENV['ACE_ROOT'],'lib') : nil,
58
+ File.directory?(ace_root) ? File.join(ENV['ACE_ROOT'], 'lib') : nil,
59
59
  ENV['DYLD_LIBRARY_PATH']
60
60
  ].compact.join(File::PATH_SEPARATOR)
61
61
  ENV['DYLD_FALLBACK_LIBRARY_PATH'] = [
62
- File.directory?(ace_root) ? File.join(ENV['ACE_ROOT'],'lib') : nil,
62
+ File.directory?(ace_root) ? File.join(ENV['ACE_ROOT'], 'lib') : nil,
63
63
  File.expand_path(File.join(root_path, 'ext')),
64
64
  ENV['DYLD_FALLBACK_LIBRARY_PATH']
65
65
  ].compact.join(File::PATH_SEPARATOR)
66
66
  else
67
67
  ENV['LD_LIBRARY_PATH'] = [
68
- File.directory?(ace_root) ? File.join(ENV['ACE_ROOT'],'lib') : nil,
68
+ File.directory?(ace_root) ? File.join(ENV['ACE_ROOT'], 'lib') : nil,
69
69
  ENV['LD_LIBRARY_PATH']
70
70
  ].compact.join(File::PATH_SEPARATOR)
71
71
  end
@@ -184,9 +184,8 @@ module TestFinder
184
184
  end
185
185
 
186
186
  # add Ruby library path for test library
187
- ENV['RUBYLIB'] = ((ENV['RUBYLIB'] || '').split(File::PATH_SEPARATOR)+[TestFinder::ROOT]).join(File::PATH_SEPARATOR)
187
+ ENV['RUBYLIB'] = ((ENV['RUBYLIB'] || '').split(File::PATH_SEPARATOR) + [TestFinder::ROOT]).join(File::PATH_SEPARATOR)
188
188
 
189
189
  if $0 == __FILE__
190
190
  TestFinder.run(ARGV)
191
191
  end
192
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r2corba
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Corino
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-25 00:00:00.000000000 Z
12
+ date: 2021-03-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ridl
@@ -29,14 +29,14 @@ dependencies:
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: 12.3.3
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: 12.3.3
42
42
  description: 'OMG CORBA v3.3 compliant CORBA language mapping implementation for Ruby.
@@ -82,8 +82,6 @@ files:
82
82
  - ext/librpoa/rpoa_export.h
83
83
  - ext/librpoa/servant.cpp
84
84
  - ext/librpoa/servant.h
85
- - ext/librpoa/srvreq_fix.cpp
86
- - ext/librpoa/srvreq_fix.h
87
85
  - ext/librpol/policies.cpp
88
86
  - ext/librpol/policies.h
89
87
  - ext/librpol/rpol_export.h
@@ -1,282 +0,0 @@
1
- /*--------------------------------------------------------------------
2
- # srvreq_fix.h - R2TAO CORBA Servant support
3
- #
4
- # Author: Martin Corino
5
- #
6
- # This program is free software; you can redistribute it and/or
7
- # modify it under the terms of the R2CORBA LICENSE which is
8
- # included with this program.
9
- #
10
- # Copyright (c) Remedy IT Expertise BV
11
- #------------------------------------------------------------------*/
12
-
13
- #ifndef __SRVREQ_FIX_CPP__
14
- #define __SRVREQ_FIX_CPP__
15
-
16
- #include "tao/DynamicInterface/DII_Arguments.h"
17
- #include "tao/DynamicInterface/Unknown_User_Exception.h"
18
- #include "tao/PortableServer/Collocated_Arguments_Converter.h"
19
- #include "tao/AnyTypeCode/NVList.h"
20
- #include "tao/GIOP_Utils.h"
21
- #include "tao/AnyTypeCode/Marshal.h"
22
- #include "tao/AnyTypeCode/TypeCode.h"
23
- #include "tao/AnyTypeCode/Any_Impl.h"
24
- #include "tao/operation_details.h"
25
- #include "tao/SystemException.h"
26
-
27
- // Reference counting for DSI ServerRequest object.
28
-
29
- CORBA::ULong
30
- R2CORBA::ServerRequest::_incr_refcount (void)
31
- {
32
- return ++this->refcount_;
33
- }
34
-
35
- CORBA::ULong
36
- R2CORBA::ServerRequest::_decr_refcount (void)
37
- {
38
- CORBA::ULong const new_count = --this->refcount_;
39
-
40
- if (new_count == 0)
41
- delete this;
42
-
43
- return new_count;
44
- }
45
-
46
- R2CORBA::ServerRequest::ServerRequest (TAO_ServerRequest &orb_server_request)
47
- : lazy_evaluation_ (0),
48
- ctx_ (CORBA::Context::_nil ()),
49
- params_ (CORBA::NVList::_nil ()),
50
- retval_ (0),
51
- exception_ (0),
52
- refcount_ (1),
53
- orb_server_request_ (orb_server_request),
54
- sent_gateway_exception_ (false)
55
- {
56
- this->orb_server_request_.is_dsi ();
57
- }
58
-
59
- R2CORBA::ServerRequest::~ServerRequest (void)
60
- {
61
- if (this->params_ != 0)
62
- {
63
- ::CORBA::release (this->params_);
64
- }
65
-
66
- delete this->retval_;
67
- delete this->exception_;
68
- }
69
-
70
- // Unmarshal in/inout params, and set up to marshal the appropriate
71
- // inout/out/return values later on.
72
- void
73
- R2CORBA::ServerRequest::arguments (CORBA::NVList_ptr &list)
74
- {
75
- // arguments() must be called before either of these.
76
- if (this->params_ != 0 || this->exception_ != 0)
77
- {
78
- throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 7, CORBA::COMPLETED_NO);
79
- }
80
-
81
- // In a collocated situation there will not be an incoming CDR stream
82
- // in which case we can get the arguments from the
83
- // operation_details using the 'collocated argument converter'.
84
- if (this->orb_server_request_.collocated ())
85
- {
86
- this->params_ = list;
87
-
88
- if (this->orb_server_request_.operation_details ()->cac () != 0)
89
- {
90
- TAO_OutputCDR output;
91
- this->orb_server_request_.operation_details ()->cac (
92
- )->dsi_convert_request (this->orb_server_request_,
93
- output);
94
-
95
- TAO_InputCDR input(output);
96
- this->params_->_tao_decode (input, CORBA::ARG_IN | CORBA::ARG_INOUT);
97
- }
98
- }
99
- else
100
- {
101
- // Save params for later use when marshaling the reply.
102
- this->params_ = list;
103
-
104
- // sometimes there is no incoming stream
105
- if (this->orb_server_request_.incoming ())
106
- {
107
- this->params_->_tao_incoming_cdr (*this->orb_server_request_.incoming (),
108
- CORBA::ARG_IN | CORBA::ARG_INOUT,
109
- this->lazy_evaluation_);
110
-
111
- // Pass this alignment back to the TAO_ServerRequest.
112
- this->orb_server_request_.dsi_nvlist_align (
113
- this->params_->_tao_target_alignment ());
114
- }
115
- }
116
- }
117
-
118
- // Store the result value. There's either an exception, or a result,
119
- // but not both of them. Results can be reported (at most once)
120
- // only after the parameter list has been provided (maybe empty).
121
- void
122
- R2CORBA::ServerRequest::set_result (const CORBA::Any &value
123
- )
124
- {
125
- // Setting a result when another result already exists or if an exception
126
- // exists or before the args have been processeed is an error.
127
- if (this->retval_ != 0 || this->exception_ != 0 || this->params_ == 0)
128
- {
129
- throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
130
- }
131
-
132
- ACE_NEW_THROW_EX (this->retval_,
133
- CORBA::Any (value),
134
- CORBA::NO_MEMORY ());
135
- }
136
-
137
- // NOTE: if "" is set, there has been a system exception,
138
- // and it will take precedence over exceptions reported using the
139
- // set_exception() mechanism of the ServerRequest, which we assume
140
- // the application writer will use to report only user exceptions.
141
- // If both types of exception happen on the same invocation, the user
142
- // exception will be lost.
143
-
144
- // Store the exception value.
145
- void
146
- R2CORBA::ServerRequest::set_exception (const CORBA::Any &value)
147
- {
148
- CORBA::TypeCode_var tc = value.type ();
149
-
150
- CORBA::TCKind const kind = tc->kind ();
151
-
152
- // set_exception() can be called at any time, but the Any arg MUST
153
- // contain an exception.
154
- if (kind != CORBA::tk_except)
155
- {
156
- throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 21, CORBA::COMPLETED_MAYBE);
157
- }
158
-
159
- ACE_NEW_THROW_EX (this->exception_,
160
- CORBA::Any (value),
161
- CORBA::NO_MEMORY ());
162
-
163
- this->orb_server_request_.reply_status (GIOP::USER_EXCEPTION);
164
- }
165
-
166
- // This method will be utilized by the DSI servant to marshal outgoing
167
- // parameters.
168
- void
169
- R2CORBA::ServerRequest::dsi_marshal (void)
170
- {
171
- // There was a user exception, no need to marshal any parameters.
172
- if (this->sent_gateway_exception_)
173
- {
174
- return;
175
- }
176
-
177
- // In a collocated situation there is no outgoing CDR stream.
178
- // So, in case of an exception we just raise the UnknownUserException
179
- // and for a regular reply we use the 'collocated argument converter'.
180
- if (this->orb_server_request_.collocated ())
181
- {
182
- if (this->orb_server_request_.reply_status () == GIOP::USER_EXCEPTION)
183
- {
184
- throw CORBA::UnknownUserException (*this->exception_);
185
- }
186
- else if (this->orb_server_request_.operation_details ()->cac () != 0)
187
- {
188
- TAO_OutputCDR output;
189
- // marshal the return value if any
190
- if (this->retval_ != 0)
191
- {
192
- this->retval_->impl ()->marshal_value (output);
193
- }
194
-
195
- // marshal the "inout" and "out" parameters.
196
- if (this->params_ != 0)
197
- {
198
- this->params_->_tao_encode (
199
- output,
200
- CORBA::ARG_INOUT | CORBA::ARG_OUT);
201
- }
202
-
203
- TAO_InputCDR input (output);
204
- // set reply parameters
205
- this->orb_server_request_.operation_details ()->cac (
206
- )->dsi_convert_reply (this->orb_server_request_,
207
- input);
208
- }
209
- }
210
- else
211
- {
212
- if (this->orb_server_request_.reply_status () == GIOP::NO_EXCEPTION)
213
- {
214
- // In DSI, we can't rely on the skeleton to do this.
215
- if (this->retval_ == 0 && this->params_ == 0)
216
- {
217
- this->orb_server_request_.argument_flag (false);
218
- }
219
-
220
- this->orb_server_request_.init_reply ();
221
-
222
- // Send the return value, if any.
223
- if (this->retval_ != 0)
224
- {
225
- this->retval_->impl ()->marshal_value (
226
- *this->orb_server_request_.outgoing ());
227
- }
228
-
229
- // Send the "inout" and "out" parameters.
230
- if (this->params_ != 0)
231
- {
232
- this->params_->_tao_encode (
233
- *this->orb_server_request_.outgoing (),
234
- CORBA::ARG_INOUT | CORBA::ARG_OUT);
235
- }
236
- }
237
- else
238
- {
239
- // This defaults to true, but just to be safe...
240
- this->orb_server_request_.argument_flag (true);
241
-
242
- // Write the reply header to the ORB request's outgoing CDR stream.
243
- this->orb_server_request_.init_reply ();
244
-
245
- this->exception_->impl ()->marshal_value (
246
- *this->orb_server_request_.outgoing ());
247
- }
248
- }
249
-
250
- // do not send in case of deferred reply
251
- if (!this->orb_server_request_.deferred_reply ())
252
- {
253
- this->orb_server_request_.tao_send_reply ();
254
- }
255
- }
256
-
257
- void
258
- R2CORBA::ServerRequest::gateway_exception_reply (ACE_CString &raw_exception)
259
- {
260
- // This defaults to 1, but just to be safe...
261
- this->orb_server_request_.argument_flag (true);
262
-
263
- // This reply path handles only user exceptions.
264
- this->orb_server_request_.reply_status (GIOP::USER_EXCEPTION);
265
-
266
- this->orb_server_request_.init_reply ();
267
-
268
- // We know nothing about this exception, so we marshal it as a block
269
- // of bytes. The outgoing stream's byte order has already been matched
270
- // to the original source of the reply.
271
- this->orb_server_request_.outgoing ()->write_octet_array (
272
- reinterpret_cast<const CORBA::Octet *> (raw_exception.fast_rep ()),
273
- static_cast<CORBA::ULong> (raw_exception.length () + ACE_CDR::MAX_ALIGNMENT)
274
- );
275
-
276
- // This will prevent the marshaling of any parameters into this reply.
277
- this->sent_gateway_exception_ = true;
278
-
279
- this->orb_server_request_.tao_send_reply ();
280
- }
281
-
282
- #endif