r2corba 1.6.1-x64-mingw-ucrt

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +173 -0
  3. data/LICENSE +59 -0
  4. data/README.rdoc +62 -0
  5. data/THANKS +54 -0
  6. data/bin/r2corba +8 -0
  7. data/bin/r2corba.bat +20 -0
  8. data/bin/ridlc +11 -0
  9. data/bin/ridlc.bat +23 -0
  10. data/bin/rins +7 -0
  11. data/bin/rins.bat +19 -0
  12. data/ext/.keep +0 -0
  13. data/lib/corba/cbase/IORMap.rb +32 -0
  14. data/lib/corba/cbase/ORB.rb +239 -0
  15. data/lib/corba/cbase/Request.rb +133 -0
  16. data/lib/corba/cbase/Streams.rb +128 -0
  17. data/lib/corba/cbase/Stub.rb +18 -0
  18. data/lib/corba/cbase/Typecode.rb +440 -0
  19. data/lib/corba/cbase/Values.rb +130 -0
  20. data/lib/corba/cbase/exception.rb +67 -0
  21. data/lib/corba/cbase/poa.rb +22 -0
  22. data/lib/corba/cbase/policies.rb +77 -0
  23. data/lib/corba/cbase/post_require.rb +13 -0
  24. data/lib/corba/cbase/require.rb +36 -0
  25. data/lib/corba/cmds/base.rb +84 -0
  26. data/lib/corba/cmds/test.rb +29 -0
  27. data/lib/corba/common/Any.rb +91 -0
  28. data/lib/corba/common/IDL.rb +100 -0
  29. data/lib/corba/common/ORB.rb +367 -0
  30. data/lib/corba/common/Object.rb +211 -0
  31. data/lib/corba/common/Request.rb +19 -0
  32. data/lib/corba/common/Servant.rb +107 -0
  33. data/lib/corba/common/Struct.rb +21 -0
  34. data/lib/corba/common/Stub.rb +78 -0
  35. data/lib/corba/common/Typecode.rb +1147 -0
  36. data/lib/corba/common/Union.rb +60 -0
  37. data/lib/corba/common/Values.rb +92 -0
  38. data/lib/corba/common/const.rb +21 -0
  39. data/lib/corba/common/exception.rb +68 -0
  40. data/lib/corba/common/require.rb +34 -0
  41. data/lib/corba/common/version.rb +21 -0
  42. data/lib/corba/idl/BiDirPolicyC.rb +62 -0
  43. data/lib/corba/idl/CosNamingC.rb +460 -0
  44. data/lib/corba/idl/CosNamingS.rb +308 -0
  45. data/lib/corba/idl/IDL.rb +20 -0
  46. data/lib/corba/idl/IORTable.pidl +61 -0
  47. data/lib/corba/idl/IORTableC.rb +116 -0
  48. data/lib/corba/idl/MessagingC.rb +903 -0
  49. data/lib/corba/idl/POAC.rb +929 -0
  50. data/lib/corba/idl/TAO_Ext.pidl +45 -0
  51. data/lib/corba/idl/TAO_ExtC.rb +178 -0
  52. data/lib/corba/idl/r2c_orb.rb +571 -0
  53. data/lib/corba/idl/require.rb +19 -0
  54. data/lib/corba/jbase/Any.rb +274 -0
  55. data/lib/corba/jbase/IORMap.rb +35 -0
  56. data/lib/corba/jbase/ORB.rb +111 -0
  57. data/lib/corba/jbase/Object.rb +98 -0
  58. data/lib/corba/jbase/Request.rb +225 -0
  59. data/lib/corba/jbase/Servant.rb +247 -0
  60. data/lib/corba/jbase/ServerRequest.rb +127 -0
  61. data/lib/corba/jbase/Streams.rb +734 -0
  62. data/lib/corba/jbase/Stub.rb +37 -0
  63. data/lib/corba/jbase/Typecode.rb +520 -0
  64. data/lib/corba/jbase/Values.rb +174 -0
  65. data/lib/corba/jbase/exception.rb +106 -0
  66. data/lib/corba/jbase/poa.rb +228 -0
  67. data/lib/corba/jbase/policies.rb +299 -0
  68. data/lib/corba/jbase/post_require.rb +13 -0
  69. data/lib/corba/jbase/require.rb +92 -0
  70. data/lib/corba/naming.rb +13 -0
  71. data/lib/corba/naming_service.rb +14 -0
  72. data/lib/corba/poa.rb +14 -0
  73. data/lib/corba/policies.rb +17 -0
  74. data/lib/corba/require.rb +16 -0
  75. data/lib/corba/svcs/ins/cos_naming.rb +432 -0
  76. data/lib/corba/svcs/ins/ins.rb +525 -0
  77. data/lib/corba/svcs/ins/naming_service.rb +118 -0
  78. data/lib/corba.rb +15 -0
  79. data/lib/ridlbe/ruby/config.rb +340 -0
  80. data/lib/ridlbe/ruby/orb.pidlc +0 -0
  81. data/lib/ridlbe/ruby/require.rb +15 -0
  82. data/lib/ridlbe/ruby/walker.rb +1605 -0
  83. data/mkrf_conf_bingem.rb +149 -0
  84. data/rakelib/bin.rake +79 -0
  85. data/rakelib/bin.rb +145 -0
  86. data/rakelib/build.rake +87 -0
  87. data/rakelib/config.rake +51 -0
  88. data/rakelib/config.rb +542 -0
  89. data/rakelib/ext.rake +183 -0
  90. data/rakelib/ext.rb +277 -0
  91. data/rakelib/ext_r2tao.rb +208 -0
  92. data/rakelib/gem.rake +251 -0
  93. data/rakelib/gem.rb +145 -0
  94. data/rakelib/package.rake +25 -0
  95. data/rakelib/test.rake +22 -0
  96. data/test/BiDirectional/Test.idl +33 -0
  97. data/test/BiDirectional/client.rb +131 -0
  98. data/test/BiDirectional/run_test.rb +67 -0
  99. data/test/BiDirectional/server.rb +167 -0
  100. data/test/CORBA_Services/Naming/BindingIterator/Test.idl +26 -0
  101. data/test/CORBA_Services/Naming/BindingIterator/client.rb +120 -0
  102. data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +81 -0
  103. data/test/CORBA_Services/Naming/BindingIterator/server.rb +108 -0
  104. data/test/CORBA_Services/Naming/Corbaname/Test.idl +26 -0
  105. data/test/CORBA_Services/Naming/Corbaname/client.rb +84 -0
  106. data/test/CORBA_Services/Naming/Corbaname/run_test.rb +87 -0
  107. data/test/CORBA_Services/Naming/Corbaname/server.rb +134 -0
  108. data/test/CORBA_Services/Naming/Simple/Test.idl +26 -0
  109. data/test/CORBA_Services/Naming/Simple/client.rb +83 -0
  110. data/test/CORBA_Services/Naming/Simple/run_test.rb +81 -0
  111. data/test/CORBA_Services/Naming/Simple/server.rb +108 -0
  112. data/test/Collocation/Diamond.idl +38 -0
  113. data/test/Collocation/run_test.rb +51 -0
  114. data/test/Collocation/test.rb +201 -0
  115. data/test/Connect_Timeout/Test.idl +26 -0
  116. data/test/Connect_Timeout/client.rb +109 -0
  117. data/test/Connect_Timeout/run_test.rb +51 -0
  118. data/test/DII/Test.idl +26 -0
  119. data/test/DII/client.rb +114 -0
  120. data/test/DII/run_test.rb +68 -0
  121. data/test/DII/server.rb +94 -0
  122. data/test/DSI/Test.idl +26 -0
  123. data/test/DSI/client.rb +65 -0
  124. data/test/DSI/run_test.rb +68 -0
  125. data/test/DSI/server.rb +105 -0
  126. data/test/Exceptions/Test.idl +47 -0
  127. data/test/Exceptions/client.rb +117 -0
  128. data/test/Exceptions/run_test.rb +68 -0
  129. data/test/Exceptions/server.rb +130 -0
  130. data/test/Hello/Test.idl +26 -0
  131. data/test/Hello/client.rb +77 -0
  132. data/test/Hello/run_test.rb +70 -0
  133. data/test/Hello/server.rb +94 -0
  134. data/test/IDL_Test/Test.idl +116 -0
  135. data/test/IDL_Test/Test_inc.idl +17 -0
  136. data/test/IDL_Test/client.rb +103 -0
  137. data/test/IDL_Test/run_test.rb +68 -0
  138. data/test/IDL_Test/server.rb +103 -0
  139. data/test/IORMap/Test.idl +26 -0
  140. data/test/IORMap/client.rb +72 -0
  141. data/test/IORMap/run_test.rb +68 -0
  142. data/test/IORMap/server.rb +113 -0
  143. data/test/IORTable/Test.idl +26 -0
  144. data/test/IORTable/client.rb +74 -0
  145. data/test/IORTable/run_test.rb +68 -0
  146. data/test/IORTable/server.rb +129 -0
  147. data/test/Implicit_Conversion/Test.idl +30 -0
  148. data/test/Implicit_Conversion/client.rb +112 -0
  149. data/test/Implicit_Conversion/run_test.rb +68 -0
  150. data/test/Implicit_Conversion/server.rb +98 -0
  151. data/test/Multi_Threading/Multiple_ORB/Test.idl +26 -0
  152. data/test/Multi_Threading/Multiple_ORB/client.rb +81 -0
  153. data/test/Multi_Threading/Multiple_ORB/run_test.rb +70 -0
  154. data/test/Multi_Threading/Multiple_ORB/server.rb +107 -0
  155. data/test/Multi_Threading/Simple/Test.idl +26 -0
  156. data/test/Multi_Threading/Simple/client.rb +92 -0
  157. data/test/Multi_Threading/Simple/run_test.rb +68 -0
  158. data/test/Multi_Threading/Simple/server.rb +117 -0
  159. data/test/Multi_Threading/Threads/Test.idl +27 -0
  160. data/test/Multi_Threading/Threads/client.rb +77 -0
  161. data/test/Multi_Threading/Threads/run_test.rb +75 -0
  162. data/test/Multi_Threading/Threads/server.rb +116 -0
  163. data/test/Multi_Threading/Threads/watchdog.rb +87 -0
  164. data/test/Multiple_Servant_Interfaces/Test.idl +33 -0
  165. data/test/Multiple_Servant_Interfaces/client.rb +69 -0
  166. data/test/Multiple_Servant_Interfaces/run_test.rb +68 -0
  167. data/test/Multiple_Servant_Interfaces/server.rb +101 -0
  168. data/test/Nil/Test.idl +26 -0
  169. data/test/Nil/run_test.rb +51 -0
  170. data/test/Nil/test.rb +80 -0
  171. data/test/OBV/AbstractInterface/client.rb +178 -0
  172. data/test/OBV/AbstractInterface/run_test.rb +68 -0
  173. data/test/OBV/AbstractInterface/server.rb +149 -0
  174. data/test/OBV/AbstractInterface/test.idl +52 -0
  175. data/test/OBV/Custom/OBV.idl +18 -0
  176. data/test/OBV/Custom/OBV_impl.rb +41 -0
  177. data/test/OBV/Custom/client.rb +85 -0
  178. data/test/OBV/Custom/run_test.rb +68 -0
  179. data/test/OBV/Custom/server.rb +99 -0
  180. data/test/OBV/Simple/OBV.idl +15 -0
  181. data/test/OBV/Simple/OBV_impl.rb +26 -0
  182. data/test/OBV/Simple/client.rb +85 -0
  183. data/test/OBV/Simple/run_test.rb +68 -0
  184. data/test/OBV/Simple/server.rb +99 -0
  185. data/test/OBV/Simple_Event/Event.idl +15 -0
  186. data/test/OBV/Simple_Event/Event_impl.rb +26 -0
  187. data/test/OBV/Simple_Event/client.rb +85 -0
  188. data/test/OBV/Simple_Event/run_test.rb +68 -0
  189. data/test/OBV/Simple_Event/server.rb +99 -0
  190. data/test/OBV/Supports/client.rb +115 -0
  191. data/test/OBV/Supports/run_test.rb +68 -0
  192. data/test/OBV/Supports/server.rb +102 -0
  193. data/test/OBV/Supports/supports.idl +32 -0
  194. data/test/OBV/Supports/supports_impl.rb +59 -0
  195. data/test/OBV/Tree/client.rb +115 -0
  196. data/test/OBV/Tree/run_test.rb +68 -0
  197. data/test/OBV/Tree/server.rb +116 -0
  198. data/test/OBV/Tree/test.idl +31 -0
  199. data/test/OBV/Truncatable/Extra.idl +26 -0
  200. data/test/OBV/Truncatable/Truncatable.idl +105 -0
  201. data/test/OBV/Truncatable/Truncatable_impl.rb +85 -0
  202. data/test/OBV/Truncatable/client.rb +278 -0
  203. data/test/OBV/Truncatable/run_test.rb +68 -0
  204. data/test/OBV/Truncatable/server.rb +88 -0
  205. data/test/OBV/ValueBox/client.rb +497 -0
  206. data/test/OBV/ValueBox/run_test.rb +68 -0
  207. data/test/OBV/ValueBox/server.rb +271 -0
  208. data/test/OBV/ValueBox/valuebox.idl +101 -0
  209. data/test/OBV/ValueBox/vb_basic.idl +75 -0
  210. data/test/OBV/ValueBox/vb_struct.idl +68 -0
  211. data/test/OBV/ValueBox/vb_union.idl +21 -0
  212. data/test/Object/Test.idl +26 -0
  213. data/test/Object/client.rb +111 -0
  214. data/test/Object/run_test.rb +68 -0
  215. data/test/Object/server.rb +125 -0
  216. data/test/POA/Test.idl +27 -0
  217. data/test/POA/run_test.rb +51 -0
  218. data/test/POA/test.rb +111 -0
  219. data/test/Param_Test/Test.idl +182 -0
  220. data/test/Param_Test/client.rb +276 -0
  221. data/test/Param_Test/run_test.rb +68 -0
  222. data/test/Param_Test/server.rb +295 -0
  223. data/test/Performance/Simple/Test.idl +26 -0
  224. data/test/Performance/Simple/client.rb +89 -0
  225. data/test/Performance/Simple/run_test.rb +68 -0
  226. data/test/Performance/Simple/server.rb +94 -0
  227. data/test/Policies/Test.idl +26 -0
  228. data/test/Policies/run_test.rb +51 -0
  229. data/test/Policies/test.rb +142 -0
  230. data/test/Timeout/client.rb +206 -0
  231. data/test/Timeout/run_test.rb +68 -0
  232. data/test/Timeout/server.rb +108 -0
  233. data/test/Timeout/test.idl +18 -0
  234. data/test/lib/assert.rb +41 -0
  235. data/test/lib/test.rb +546 -0
  236. data/test/test_runner.rb +191 -0
  237. metadata +318 -0
@@ -0,0 +1,367 @@
1
+ #--------------------------------------------------------------------
2
+ # ORB.rb - Common CORBA ORB definitions
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
+ module R2CORBA
14
+ module CORBA
15
+
16
+ def CORBA.ORB_init(*args)
17
+ # actual CORBA wrapper implementation implements
18
+ # the ORB.init method
19
+ self::ORB.init(*args)
20
+ end
21
+
22
+ module ORB
23
+ @@wrapper_klass = Class.new do
24
+ include ::R2CORBA::CORBA::ORB
25
+ def initialize(norb)
26
+ @orb_ = norb
27
+ end
28
+ attr_reader :orb_
29
+ end
30
+
31
+ def self._wrap_native(norb)
32
+ raise ArgumentError, 'Expected org.omg.CORBA.ORB' unless norb.nil? || norb.is_a?(Native::ORB)
33
+ norb.nil?() ? norb : @@wrapper_klass.new(norb)
34
+ end
35
+
36
+ ## init() or init(orb_id, prop = {}) or init(argv, orb_id, prop={}) or init(argv, prop={})
37
+ def self.init(*args)
38
+ raise ::CORBA::NO_IMPLEMENT
39
+ end
40
+
41
+ @@cached_orb = nil
42
+
43
+ def self._orb
44
+ @@cached_orb || _singleton_orb_init
45
+ end
46
+
47
+ def ==(other)
48
+ self.class == other.class && self.orb_.eql?(other.orb_)
49
+ end
50
+
51
+ def hash
52
+ self.orb_.hash
53
+ end
54
+
55
+ def dup
56
+ self
57
+ end
58
+
59
+ def clone
60
+ self
61
+ end
62
+
63
+ # obj ::CORBA::Object
64
+ # ret ::String
65
+ def object_to_string(obj)
66
+ raise CORBA::BAD_PARAM.new('CORBA::Object required', 0, CORBA::COMPLETED_NO) unless obj.is_a?(CORBA::Object)
67
+ begin
68
+ self.orb_.object_to_string(obj.objref_)
69
+ rescue ::NativeException
70
+ CORBA::Exception.native2r($!)
71
+ end
72
+ end
73
+
74
+ # str ::String
75
+ # ret ::CORBA::Object
76
+ def string_to_object(str)
77
+ begin
78
+ Object._wrap_native(self.orb_.string_to_object(str))
79
+ rescue ::NativeException
80
+ CORBA::Exception.native2r($!)
81
+ end
82
+ end
83
+
84
+ # str ::Integer
85
+ # ret ::CORBA::NVList
86
+ def create_list(count)
87
+ raise CORBA::NO_IMPLEMENT
88
+ end
89
+
90
+ # str OperationDef
91
+ # ret ::CORBA::NVList
92
+ def create_operation_list(oper)
93
+ raise CORBA::NO_IMPLEMENT
94
+ end
95
+
96
+ # ret Context
97
+ def get_default_context()
98
+ raise CORBA::NO_IMPLEMENT
99
+ end
100
+
101
+ # req RequestSeq
102
+ # ret void
103
+ def send_multiple_request_oneway(req)
104
+ raise CORBA::NO_IMPLEMENT
105
+ end
106
+
107
+ # req RequestSeq
108
+ # ret void
109
+ def send_multiple_request_deferred(req)
110
+ raise CORBA::NO_IMPLEMENT
111
+ end
112
+
113
+ # ret boolean
114
+ def poll_next_response()
115
+ raise CORBA::NO_IMPLEMENT
116
+ end
117
+
118
+ # ret Request
119
+ def get_next_response()
120
+ raise CORBA::NO_IMPLEMENT
121
+ end
122
+
123
+ # Service information operations
124
+
125
+ # ServiceType service_type
126
+ # ret [boolean, ServiceInformation]
127
+ def get_service_information(service_type)
128
+ raise CORBA::NO_IMPLEMENT
129
+ end
130
+
131
+ # ret [::String, ...]
132
+ def list_initial_services()
133
+ self.orb_.list_initial_services()
134
+ end
135
+
136
+ =begin
137
+ // Initial reference operations
138
+ =end
139
+ # ::String identifier
140
+ # ret Object
141
+ # raises InvalidName
142
+ def resolve_initial_references(identifier)
143
+ begin
144
+ Object._wrap_native(self.orb_.resolve_initial_references(identifier))
145
+ rescue ::NativeException
146
+ CORBA::Exception.native2r($!)
147
+ end
148
+ end
149
+
150
+ # ::String identifier
151
+ # CORBA::Object obj
152
+ # ret void
153
+ # raises InvalidName
154
+ def register_initial_reference(identifier, obj)
155
+ raise ::CORBA::NO_IMPLEMENT
156
+ end
157
+
158
+ =begin
159
+ // Type code creation operations
160
+ =end
161
+ # String id
162
+ # String name
163
+ # [] members
164
+ # ret TypeCode
165
+ def create_struct_tc(id, name, *members)
166
+ return CORBA::TypeCode::Struct.new(id.to_s.freeze, name.to_s, nil, members)
167
+ end
168
+
169
+ # String id
170
+ # String name
171
+ # [] members
172
+ # ret TypeCode
173
+ def create_exception_tc(id, name, *members)
174
+ return CORBA::TypeCode::Except.new(id.to_s.freeze, name.to_s, nil, members)
175
+ end
176
+
177
+ # String id
178
+ # String name
179
+ # TypeCode discriminator_type
180
+ # [] members
181
+ # ret TypeCode
182
+ def create_union_tc(id, name, discriminator_type, *members)
183
+ return CORBA::TypeCode::Union.new(id.to_s.freeze, name.to_s, nil, discriminator_type, members)
184
+ end
185
+
186
+ # String id
187
+ # String name
188
+ # [] members
189
+ # ret TypeCode
190
+ def create_enum_tc(id, name, *members)
191
+ return CORBA::TypeCode::Enum.new(id.to_s.freeze, name.to_s, members)
192
+ end
193
+
194
+ # String id
195
+ # String name
196
+ # TypeCode original_type
197
+ # ret TypeCode
198
+ def create_alias_tc(id, name, original_type)
199
+ return CORBA::TypeCode::Alias.new(id.to_s.freeze, name.to_s, nil, original_type)
200
+ end
201
+
202
+ # String id
203
+ # String name
204
+ # ret TypeCode
205
+ def create_interface_tc(id, name)
206
+ return CORBA::TypeCode::ObjectRef.new(id.to_s.freeze, name.to_s, nil)
207
+ end
208
+
209
+ # Integer bound
210
+ # ret TypeCode
211
+ def create_string_tc(bound = nil)
212
+ return CORBA::TypeCode::String.new(bound)
213
+ end
214
+
215
+ # Integer bound
216
+ # ret TypeCode
217
+ def create_wstring_tc(bound = nil)
218
+ return CORBA::TypeCode::WString.new(bound)
219
+ end
220
+
221
+ # Integer(ushort) digits
222
+ # Integer(short) scale
223
+ # ret TypeCode
224
+ def create_fixed_tc(digits, scale)
225
+ return CORBA::TypeCode::Fixed.new(digits, scale)
226
+ end
227
+
228
+ # Integer bound
229
+ # TypeCode element_type
230
+ # ret TypeCode
231
+ def create_sequence_tc(bound, element_type)
232
+ return CORBA::TypeCode::Sequence.new(element_type, bound)
233
+ end
234
+
235
+ # Integer length
236
+ # TypeCode element_type
237
+ # ret TypeCode
238
+ def create_array_tc(length, element_type)
239
+ return CORBA::TypeCode::Array.new(element_type, length)
240
+ end
241
+
242
+ # String id
243
+ # ret TypeCode
244
+ def create_recursive_tc(id)
245
+ return CORBA::TypeCode::Recursive.new(id.to_s.freeze)
246
+ end
247
+
248
+ # RepositoryId id
249
+ # Identifier name
250
+ # ValueModifier type_modifier
251
+ # TypeCode concrete_base
252
+ # ValueMemberSeq members
253
+ # ret TypeCode
254
+ def create_value_tc(id, name, type_modifier, concrete_base, members)
255
+ return CORBA::TypeCode::Valuetype.new(id, name, type_modifier, concrete_base, members)
256
+ end
257
+
258
+ # RepositoryId id
259
+ # Identifier name
260
+ # TypeCode boxed_type
261
+ # ret TypeCode
262
+ def create_value_box_tc(id, name, boxed_type)
263
+ return CORBA::TypeCode::Valuebox.new(id, name, boxed_type)
264
+ end
265
+
266
+ # RepositoryId id
267
+ # Identifier name
268
+ # ret TypeCode
269
+ def create_native_tc(id, name)
270
+ # TODO ORB::create_native_tc
271
+ raise ::CORBA::NO_IMPLEMENT
272
+ end
273
+
274
+ # RepositoryId id
275
+ # Identifier name
276
+ # ret TypeCode
277
+ def create_abstract_interface_tc(id, name)
278
+ return CORBA::TypeCode::AbstractInterface.new(id.to_s.freeze, name.to_s, nil)
279
+ end
280
+
281
+ =begin
282
+ // Thread related operations
283
+ =end
284
+
285
+ # ret boolean
286
+ def work_pending()
287
+ begin
288
+ self.orb_.work_pending()
289
+ rescue ::NativeException
290
+ CORBA::Exception.native2r($!)
291
+ end
292
+ end
293
+
294
+ # ret void
295
+ def perform_work()
296
+ begin
297
+ self.orb_.perform_work()
298
+ rescue ::NativeException
299
+ CORBA::Exception.native2r($!)
300
+ end
301
+ end
302
+
303
+ # ret void
304
+ def run()
305
+ begin
306
+ self.orb_.run()
307
+ rescue ::NativeException
308
+ CORBA::Exception.native2r($!)
309
+ end
310
+ end
311
+
312
+ # boolean wait_for_completion
313
+ # ret void
314
+ def shutdown(wait_for_completion = false)
315
+ begin
316
+ self.orb_.shutdown(wait_for_completion)
317
+ rescue ::NativeException
318
+ CORBA::Exception.native2r($!)
319
+ end
320
+ end
321
+
322
+ # ret void
323
+ def destroy()
324
+ begin
325
+ self.orb_.destroy()
326
+ rescue ::NativeException
327
+ CORBA::Exception.native2r($!)
328
+ end
329
+ end
330
+
331
+ =begin
332
+ // Policy related operations
333
+ =end
334
+
335
+ # PolicyType type
336
+ # any val
337
+ # ret Policy
338
+ # raises PolicyError
339
+ def create_policy(type, val)
340
+ raise ::CORBA::NO_IMPLEMENT
341
+ end
342
+
343
+ =begin
344
+ // Value factory operations
345
+ =end
346
+ # RepositoryId id
347
+ # ValueFactory factory
348
+ # ret ValueFactory
349
+ def register_value_factory(id, factory)
350
+ self.orb_().register_value_factory(id, factory)
351
+ end
352
+
353
+ # RepositoryId id
354
+ # ret void
355
+ def unregister_value_factory(id)
356
+ self.orb_().unregister_value_factory(id)
357
+ end
358
+
359
+ # RepositoryId id
360
+ # ret ValueFactory
361
+ def lookup_value_factory(id)
362
+ self.orb_().lookup_value_factory(id)
363
+ end
364
+ end # ORB
365
+
366
+ end # CORBA
367
+ end # R2CORBA
@@ -0,0 +1,211 @@
1
+ #--------------------------------------------------------------------
2
+ # Object.rb - Common CORBA Object definitions
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
+ module R2CORBA
13
+ module CORBA
14
+
15
+ def CORBA.is_nil(obj)
16
+ if obj.nil?
17
+ return true
18
+ elsif obj.is_a?(R2CORBA::CORBA::Object) || obj.respond_to?(:_is_nil?)
19
+ return obj._is_nil?()
20
+ end
21
+ false
22
+ end
23
+
24
+ module Object
25
+ @@wrapper_klass = Class.new do
26
+ include CORBA::Object
27
+ def initialize(nobj)
28
+ @objref_ = nobj
29
+ end
30
+
31
+ def _free_ref
32
+ self._release
33
+ end
34
+ attr_reader :objref_
35
+ def self.name
36
+ 'CORBA::Object'
37
+ end
38
+ end
39
+
40
+ def self._wrap_native(nobj)
41
+ raise ArgumentError, 'Expected org.omg.CORBA.Object' unless nobj.nil? || nobj.is_a?(Native::Object)
42
+ (nobj.nil? || (nobj.respond_to?(:_is_nil) && nobj._is_nil)) ? nil : @@wrapper_klass.new(nobj)
43
+ end
44
+
45
+ def self._narrow(obj)
46
+ raise CORBA::BAD_PARAM.new('not an object reference', 0, CORBA::COMPLETED_NO) unless obj.nil? || obj.is_a?(CORBA::Object) || obj.is_a?(Native::Object)
47
+ obj = self._wrap_native(obj) if obj.is_a?(Native::Object)
48
+ obj
49
+ end
50
+
51
+ def self._tc
52
+ CORBA._tc_Object
53
+ end
54
+
55
+ #------------------- 4.3 "Object Reference Operations"
56
+
57
+ def ==(other)
58
+ self.class == other.class && self.objref_.eql?(other.objref_)
59
+ end
60
+
61
+ def hash
62
+ self.objref_.hash
63
+ end
64
+
65
+ def dup
66
+ self
67
+ end
68
+
69
+ def clone
70
+ self
71
+ end
72
+
73
+ # ret InterfaceDef
74
+ def _get_interface()
75
+ raise ::CORBA::NO_IMPLEMENT
76
+ end
77
+
78
+ # ret boolean
79
+ def _is_nil?()
80
+ self.objref_.nil? || (self.objref_.respond_to?(:_is_nil) && self.objref_._is_nil)
81
+ end
82
+
83
+ # ret ::CORBA::Object
84
+ def _duplicate()
85
+ return nil if self._is_nil?()
86
+ begin
87
+ self._wrap_native(self.objref_._duplicate)
88
+ rescue ::NativeException
89
+ CORBA::Exception.native2r($!)
90
+ end
91
+ end
92
+
93
+ # ret void
94
+ def _release()
95
+ self.objref_._release unless self.objref_.nil?
96
+ @objref_ = nil
97
+ end
98
+
99
+ # ::String logical_type_id
100
+ # ret boolean
101
+ def _is_a?(logical_type_id)
102
+ return false if self._is_nil?()
103
+ begin
104
+ self.objref_._is_a(logical_type_id)
105
+ rescue ::NativeException
106
+ CORBA::Exception.native2r($!)
107
+ end
108
+ end
109
+
110
+ # ret boolean
111
+ def _non_existent?()
112
+ raise CORBA::INV_OBJREF.new if self._is_nil?()
113
+ begin
114
+ self.objref_._non_existent
115
+ rescue ::NativeException
116
+ CORBA::Exception.native2r($!)
117
+ end
118
+ end
119
+
120
+ # ::CORBA::Object other_object
121
+ # ret boolean
122
+ def _is_equivalent?(other_object)
123
+ raise CORBA::INV_OBJREF.new if self._is_nil?()
124
+ begin
125
+ self.objref_._is_equivalent(other_object)
126
+ rescue ::NativeException
127
+ CORBA::Exception.native2r($!)
128
+ end
129
+ end
130
+
131
+ # Integer(ulong) maximum
132
+ # ret unsigned long
133
+ def _hash(maximum)
134
+ raise CORBA::INV_OBJREF.new if self._is_nil?()
135
+ begin
136
+ self.objref_._hash(maximum)
137
+ rescue ::NativeException
138
+ CORBA::Exception.native2r($!)
139
+ end
140
+ end
141
+
142
+ # ret ::String
143
+ def _repository_id()
144
+ raise CORBA::INV_OBJREF.new if self._is_nil?()
145
+ ## if this object ref has already been narrowed
146
+ return self._interface_repository_id if self.respond_to?(:_interface_repository_id)
147
+ ## ask the remote side
148
+ begin
149
+ self.objref_._repository_id()
150
+ rescue ::NativeException
151
+ CORBA::Exception.native2r($!)
152
+ end
153
+ end
154
+
155
+ # def PolicyType policy_type
156
+ # ret Policy
157
+ def _get_policy(policy_type)
158
+ raise ::CORBA::NO_IMPLEMENT
159
+ end
160
+
161
+ # PolicyList policies
162
+ # SetOverrideType set_add
163
+ # ret ::CORBA::Object
164
+ def _set_policy_overrides(policies, set_add)
165
+ raise ::CORBA::NO_IMPLEMENT
166
+ end
167
+
168
+ # int[] types
169
+ # ret PolicyList
170
+ def _get_policy_overrides(types)
171
+ raise ::CORBA::NO_IMPLEMENT
172
+ end
173
+
174
+ # PolicyList inconsistent_policies
175
+ # ret bool
176
+ def _validate_connection(inconsistent_policies)
177
+ raise ::CORBA::NO_IMPLEMENT
178
+ end
179
+
180
+ # ret ::CORBA::Object
181
+ def _get_component()
182
+ raise CORBA::INV_OBJREF.new if self._is_nil?()
183
+ begin
184
+ CORBA::Object._wrap_native(self.objref_._get_component())
185
+ rescue ::NativeException
186
+ CORBA::Exception.native2r($!)
187
+ end
188
+ end
189
+
190
+ # ret CORBA::ORB
191
+ def _get_orb()
192
+ raise CORBA::INV_OBJREF.new if self._is_nil?()
193
+ begin
194
+ CORBA::ORB._wrap_native(self.objref_._get_orb)
195
+ rescue ::NativeException
196
+ CORBA::Exception.native2r($!)
197
+ end
198
+ end
199
+
200
+ def _request(operation)
201
+ raise CORBA::INV_OBJREF.new if self._is_nil?()
202
+ begin
203
+ self.objref_._request(operation.to_s)
204
+ rescue ::NativeException
205
+ CORBA::Exception.native2r($!)
206
+ end
207
+ end
208
+
209
+ end # Object
210
+ end # CORBA
211
+ end # R2CORBA
@@ -0,0 +1,19 @@
1
+ #--------------------------------------------------------------------
2
+ # Request.rb - Common CORBA Request definitions
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
+ module R2CORBA
13
+ module CORBA
14
+
15
+ module Request
16
+ end
17
+
18
+ end # CORBA
19
+ end # R2CORBA
@@ -0,0 +1,107 @@
1
+ #--------------------------------------------------------------------
2
+ # Servant.rb - 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
+ module R2CORBA
14
+
15
+ module PortableServer
16
+
17
+ class Servant
18
+
19
+ module Intf
20
+ Id = 'IDL:omg.org/CORBA/Object:1.0'.freeze
21
+ Ids = [ Id ].freeze
22
+ Operations = {}.freeze
23
+ end
24
+
25
+ def Servant.include(*modules)
26
+ modules.reverse_each { |mod|
27
+ if mod.respond_to?(:superclass) && mod.superclass == R2CORBA::PortableServer::Servant
28
+ include_srv(mod)
29
+ elsif mod < CORBA::ValueBase && mod.const_defined?(:Intf)
30
+ include_valuetype(mod)
31
+ else
32
+ super(mod)
33
+ end
34
+ }
35
+ end
36
+
37
+ def get_operation_signature(opsym)
38
+ self.class::Operations[opsym]
39
+ end
40
+
41
+ private
42
+ def Servant.include_interface(intf)
43
+ self::Intf.module_eval(%Q{ include ::#{intf.name} })
44
+ self::Intf::Operations.merge!(intf::Operations)
45
+ self::Intf::Ids.concat(intf::Ids)
46
+ end
47
+
48
+ def Servant.include_srv(srv)
49
+ if !self.const_defined?('Id')
50
+ if self.superclass == R2CORBA::PortableServer::Servant || !self.constants.include?('Id')
51
+ self.const_set('Id', srv::Id.dup.freeze)
52
+ else
53
+ self.const_set('Id', self::Id.dup.freeze)
54
+ end
55
+ end
56
+ if !self.const_defined?('Ids')
57
+ if self.superclass == R2CORBA::PortableServer::Servant || !self.constants.include?('Ids')
58
+ self.const_set('Ids', [])
59
+ else
60
+ self.const_set('Ids', self::Ids.dup)
61
+ end
62
+ end
63
+ if !self.const_defined?('Operations')
64
+ if self.superclass == R2CORBA::PortableServer::Servant || !self.constants.include?('Operations')
65
+ self.const_set('Operations', {})
66
+ else
67
+ self.const_set('Operations', self::Operations.dup)
68
+ end
69
+ end
70
+ self.module_eval(%Q{ include ::#{srv.name}::Intf })
71
+ self::Operations.merge!(srv::Operations)
72
+ self::Ids.concat(srv::Ids).uniq!
73
+ end
74
+ end
75
+
76
+ def Servant.include_valuetype(vt)
77
+ self.module_eval do
78
+ if vt < CORBA::Portable::CustomValueBase
79
+ include CORBA::Portable::CustomValueBase unless self.include?(CORBA::Portable::CustomValueBase)
80
+ else
81
+ include CORBA::ValueBase unless self.include?(CORBA::ValueBase)
82
+ end
83
+ self.const_set(:TRUNCATABLE_IDS, vt::TRUNCATABLE_IDS)
84
+ self.const_set(:VT_TC, vt._tc)
85
+ # @@tc_vt_ = vt._tc
86
+ def self._tc
87
+ # @@tc_vt_
88
+ self.const_get(:VT_TC)
89
+ end
90
+ include vt::Intf
91
+ end
92
+ end
93
+
94
+ class DynamicImplementation < Servant
95
+ def invoke(request)
96
+ if self.class.const_defined?('OPTABLE') && self.class::OPTABLE.has_key?(request.operation)
97
+ request.describe(self.class::OPTABLE[request.operation])
98
+ return self.__send__(request.operation, *request.arguments) { request }
99
+ else
100
+ return self.__send__(request.operation) { request }
101
+ end
102
+ end
103
+ end
104
+
105
+ end
106
+
107
+ end
@@ -0,0 +1,21 @@
1
+ #--------------------------------------------------------------------
2
+ # Struct.rb - Definition of CORBA Struct class as baseclass for all
3
+ # IDL defined structs
4
+ #
5
+ # Author: Martin Corino
6
+ #
7
+ # This program is free software; you can redistribute it and/or
8
+ # modify it under the terms of the R2CORBA LICENSE which is
9
+ # included with this program.
10
+ #
11
+ # Copyright (c) Remedy IT Expertise BV
12
+ #--------------------------------------------------------------------
13
+
14
+ module R2CORBA
15
+ module CORBA
16
+ module Portable
17
+ class Struct
18
+ end
19
+ end
20
+ end
21
+ end