r2corba 1.7.0-universal-java → 1.7.1-universal-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/corba/cbase/ORB.rb +9 -8
- data/lib/corba/cbase/Request.rb +4 -6
- data/lib/corba/cbase/Streams.rb +20 -20
- data/lib/corba/cbase/Typecode.rb +12 -41
- data/lib/corba/cbase/Values.rb +1 -4
- data/lib/corba/cbase/exception.rb +0 -2
- data/lib/corba/cbase/poa.rb +2 -2
- data/lib/corba/cbase/policies.rb +9 -8
- data/lib/corba/cbase/require.rb +1 -1
- data/lib/corba/cmds/base.rb +0 -1
- data/lib/corba/common/Any.rb +1 -2
- data/lib/corba/common/IDL.rb +3 -7
- data/lib/corba/common/ORB.rb +19 -19
- data/lib/corba/common/Object.rb +32 -22
- data/lib/corba/common/Request.rb +0 -2
- data/lib/corba/common/Servant.rb +4 -9
- data/lib/corba/common/Stub.rb +9 -7
- data/lib/corba/common/Typecode.rb +44 -27
- data/lib/corba/common/Values.rb +0 -1
- data/lib/corba/common/require.rb +1 -3
- data/lib/corba/common/version.rb +1 -3
- data/lib/corba/idl/IDL.rb +0 -2
- data/lib/corba/idl/require.rb +2 -2
- data/lib/corba/jbase/Any.rb +34 -35
- data/lib/corba/jbase/ORB.rb +5 -6
- data/lib/corba/jbase/Object.rb +10 -10
- data/lib/corba/jbase/Request.rb +8 -9
- data/lib/corba/jbase/Servant.rb +28 -32
- data/lib/corba/jbase/ServerRequest.rb +10 -8
- data/lib/corba/jbase/Streams.rb +80 -78
- data/lib/corba/jbase/Stub.rb +1 -1
- data/lib/corba/jbase/Typecode.rb +18 -46
- data/lib/corba/jbase/Values.rb +0 -1
- data/lib/corba/jbase/exception.rb +2 -1
- data/lib/corba/jbase/poa.rb +18 -17
- data/lib/corba/jbase/policies.rb +42 -45
- data/lib/corba/jbase/require.rb +3 -3
- data/lib/corba/naming_service.rb +1 -1
- data/lib/corba/poa.rb +1 -1
- data/lib/corba/policies.rb +2 -2
- data/lib/corba/svcs/ins/cos_naming.rb +23 -12
- data/lib/corba/svcs/ins/ins.rb +5 -5
- data/lib/corba/svcs/ins/naming_service.rb +1 -1
- data/lib/corba.rb +1 -1
- data/lib/ridlbe/ruby/config.rb +2 -8
- data/lib/ridlbe/ruby/orb.pidlc +0 -0
- data/lib/ridlbe/ruby/walker.rb +94 -108
- data/rakelib/gem.rake +0 -30
- metadata +3 -3
data/lib/corba/jbase/Typecode.rb
CHANGED
@@ -9,12 +9,11 @@
|
|
9
9
|
#
|
10
10
|
# Copyright (c) Remedy IT Expertise BV
|
11
11
|
#--------------------------------------------------------------------
|
12
|
-
require 'corba/jbase/Any
|
12
|
+
require 'corba/jbase/Any'
|
13
13
|
require 'bigdecimal'
|
14
14
|
|
15
15
|
module R2CORBA
|
16
16
|
module CORBA
|
17
|
-
|
18
17
|
# define typecode kind constants
|
19
18
|
['tk_null',
|
20
19
|
'tk_void',
|
@@ -53,7 +52,6 @@ module R2CORBA
|
|
53
52
|
end
|
54
53
|
|
55
54
|
class TypeCode
|
56
|
-
|
57
55
|
def TypeCode.native_kind(ntc)
|
58
56
|
ntc.kind.value
|
59
57
|
end
|
@@ -75,7 +73,6 @@ module R2CORBA
|
|
75
73
|
end
|
76
74
|
|
77
75
|
class Recursive < CORBA::TypeCode
|
78
|
-
|
79
76
|
def initialize(id)
|
80
77
|
begin
|
81
78
|
@tc_ = CORBA::ORB._orb.create_recursive_tc(id)
|
@@ -83,11 +80,9 @@ module R2CORBA
|
|
83
80
|
CORBA::Exception.native2r($!)
|
84
81
|
end
|
85
82
|
end
|
86
|
-
|
87
83
|
end # Recursive
|
88
84
|
|
89
85
|
class String < CORBA::TypeCode
|
90
|
-
|
91
86
|
def initialize(*args)
|
92
87
|
if CORBA::Native::TypeCode === args.first
|
93
88
|
@tc_ = args.first
|
@@ -99,11 +94,9 @@ module R2CORBA
|
|
99
94
|
end
|
100
95
|
end
|
101
96
|
end
|
102
|
-
|
103
97
|
end # String
|
104
98
|
|
105
99
|
class WString < CORBA::TypeCode
|
106
|
-
|
107
100
|
def initialize(*args)
|
108
101
|
if CORBA::Native::TypeCode === args.first
|
109
102
|
@tc_ = args.first
|
@@ -115,11 +108,9 @@ module R2CORBA
|
|
115
108
|
end
|
116
109
|
end
|
117
110
|
end
|
118
|
-
|
119
111
|
end # WString
|
120
112
|
|
121
113
|
class Fixed < CORBA::TypeCode
|
122
|
-
|
123
114
|
def initialize(*args)
|
124
115
|
if CORBA::Native::TypeCode === args.first
|
125
116
|
@tc_ = args.first
|
@@ -132,17 +123,16 @@ module R2CORBA
|
|
132
123
|
end
|
133
124
|
end
|
134
125
|
end
|
135
|
-
|
136
126
|
end # Fixed
|
137
127
|
|
138
128
|
class Sequence < CORBA::TypeCode
|
139
|
-
|
140
129
|
def initialize(*args)
|
141
130
|
if CORBA::Native::TypeCode === args.first
|
142
131
|
@tc_ = args.first
|
143
132
|
else
|
144
133
|
element_tc, bound = args
|
145
134
|
raise ArgumentError, 'expected CORBA::TypeCode' unless element_tc.is_a?(CORBA::TypeCode)
|
135
|
+
|
146
136
|
begin
|
147
137
|
@tc_ = CORBA::ORB._orb.create_sequence_tc(bound.to_i, element_tc.tc_)
|
148
138
|
rescue ::NativeException
|
@@ -150,11 +140,9 @@ module R2CORBA
|
|
150
140
|
end
|
151
141
|
end
|
152
142
|
end
|
153
|
-
|
154
143
|
end
|
155
144
|
|
156
145
|
class Array < CORBA::TypeCode
|
157
|
-
|
158
146
|
def initialize(*args)
|
159
147
|
if CORBA::Native::TypeCode === args.first
|
160
148
|
@tc_ = args.first
|
@@ -162,6 +150,7 @@ module R2CORBA
|
|
162
150
|
content_tc = args.shift
|
163
151
|
length = args
|
164
152
|
raise ArgumentError, 'expected CORBA::TypeCode' unless content_tc.is_a?(CORBA::TypeCode)
|
153
|
+
|
165
154
|
if length.size > 1
|
166
155
|
this_len = length.shift
|
167
156
|
content_tc = self.class.new(content_tc, *length)
|
@@ -175,19 +164,15 @@ module R2CORBA
|
|
175
164
|
end
|
176
165
|
end
|
177
166
|
end
|
178
|
-
|
179
167
|
end # Array
|
180
168
|
|
181
169
|
class IdentifiedTypeCode < CORBA::TypeCode
|
182
|
-
|
183
170
|
def initialize(id)
|
184
171
|
CORBA::TypeCode.register_id_type(id.to_s, self)
|
185
172
|
end
|
186
|
-
|
187
173
|
end # IdentifiedTypeCode
|
188
174
|
|
189
175
|
class Alias < IdentifiedTypeCode
|
190
|
-
|
191
176
|
def initialize(*args)
|
192
177
|
if CORBA::Native::TypeCode === args.first
|
193
178
|
@tc_ = args.first
|
@@ -196,6 +181,7 @@ module R2CORBA
|
|
196
181
|
else
|
197
182
|
id, name, orig_tc, type = args
|
198
183
|
raise ArgumentError, 'expected CORBA::TypeCode' unless orig_tc.is_a?(CORBA::TypeCode)
|
184
|
+
|
199
185
|
begin
|
200
186
|
@tc_ = CORBA::ORB._orb.create_alias_tc(id.to_s, name.to_s, orig_tc.tc_)
|
201
187
|
rescue ::NativeException
|
@@ -205,11 +191,9 @@ module R2CORBA
|
|
205
191
|
super(id)
|
206
192
|
end
|
207
193
|
end
|
208
|
-
|
209
194
|
end # Alias
|
210
195
|
|
211
196
|
class Valuetype < IdentifiedTypeCode
|
212
|
-
|
213
197
|
def initialize(*args)
|
214
198
|
if CORBA::Native::TypeCode === args.first
|
215
199
|
@tc_ = args.first
|
@@ -223,6 +207,7 @@ module R2CORBA
|
|
223
207
|
id, name, modifier, base, members_, type_ = args
|
224
208
|
raise ArgumentError, 'expected CORBA::Typecode' unless base.nil? || base.is_a?(CORBA::TypeCode)
|
225
209
|
raise ArgumentError, 'expected members Array' unless members_.is_a?(::Array) || type_.nil?
|
210
|
+
|
226
211
|
if type_.nil? && !members_.is_a?(::Array)
|
227
212
|
type_ = members_
|
228
213
|
members_ = []
|
@@ -258,11 +243,9 @@ module R2CORBA
|
|
258
243
|
CORBA::Exception.native2r($!)
|
259
244
|
end
|
260
245
|
end
|
261
|
-
|
262
246
|
end # Valuetype
|
263
247
|
|
264
248
|
class Eventtype < Valuetype
|
265
|
-
|
266
249
|
protected
|
267
250
|
|
268
251
|
def _create_tc(id, name, modifier, base, jmembers)
|
@@ -279,11 +262,9 @@ module R2CORBA
|
|
279
262
|
CORBA::Exception.native2r($!)
|
280
263
|
end
|
281
264
|
end
|
282
|
-
|
283
265
|
end # Eventtype
|
284
266
|
|
285
267
|
class Valuebox < IdentifiedTypeCode
|
286
|
-
|
287
268
|
def initialize(*args)
|
288
269
|
if CORBA::Native::TypeCode === args.first
|
289
270
|
@tc_ = args.first
|
@@ -292,6 +273,7 @@ module R2CORBA
|
|
292
273
|
else
|
293
274
|
id, name, boxed_tc, type = args
|
294
275
|
raise ArgumentError, 'expected CORBA::TypeCode' unless boxed_tc.is_a?(CORBA::TypeCode)
|
276
|
+
|
295
277
|
begin
|
296
278
|
@tc_ = CORBA::ORB._orb.create_value_box_tc(id.to_s, name.to_s, boxed_tc.tc_)
|
297
279
|
rescue ::NativeException
|
@@ -301,11 +283,9 @@ module R2CORBA
|
|
301
283
|
super(id)
|
302
284
|
end
|
303
285
|
end
|
304
|
-
|
305
286
|
end # Valuebox
|
306
287
|
|
307
288
|
class ObjectRef < IdentifiedTypeCode
|
308
|
-
|
309
289
|
def initialize(*args)
|
310
290
|
if CORBA::Native::TypeCode === args.first
|
311
291
|
@tc_ = args.first
|
@@ -322,11 +302,9 @@ module R2CORBA
|
|
322
302
|
super(id)
|
323
303
|
end
|
324
304
|
end
|
325
|
-
|
326
305
|
end # ObjectRef
|
327
306
|
|
328
307
|
class AbstractInterface < IdentifiedTypeCode
|
329
|
-
|
330
308
|
def initialize(*args)
|
331
309
|
if CORBA::Native::TypeCode === args.first
|
332
310
|
@tc_ = args.first
|
@@ -343,11 +321,9 @@ module R2CORBA
|
|
343
321
|
super(id)
|
344
322
|
end
|
345
323
|
end
|
346
|
-
|
347
324
|
end # AbstractInterface
|
348
325
|
|
349
326
|
class Struct < IdentifiedTypeCode
|
350
|
-
|
351
327
|
def initialize(*args)
|
352
328
|
if CORBA::Native::TypeCode === args.first
|
353
329
|
@tc_ = args.first
|
@@ -360,6 +336,7 @@ module R2CORBA
|
|
360
336
|
else
|
361
337
|
id, name, members_, type_ = args
|
362
338
|
raise ArgumentError, 'expected members Array' unless members_.is_a?(::Array) || type_.nil?
|
339
|
+
|
363
340
|
if type_.nil? && !members_.is_a?(::Array)
|
364
341
|
type_ = members_
|
365
342
|
members_ = []
|
@@ -368,7 +345,7 @@ module R2CORBA
|
|
368
345
|
@members = []
|
369
346
|
members_.each { |n, tc| add_member(n, tc) }
|
370
347
|
jmembers = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::StructMember.java_class, @members.size)
|
371
|
-
@members.each_with_index {|(mn, mtc), i| jmembers[i] = CORBA::Native::StructMember.new(mn.to_s, mtc.tc_, nil) }
|
348
|
+
@members.each_with_index { |(mn, mtc), i| jmembers[i] = CORBA::Native::StructMember.new(mn.to_s, mtc.tc_, nil) }
|
372
349
|
@tc_ = _create_tc(id, name, jmembers)
|
373
350
|
super(id)
|
374
351
|
end
|
@@ -383,21 +360,21 @@ module R2CORBA
|
|
383
360
|
CORBA::Exception.native2r($!)
|
384
361
|
end
|
385
362
|
end
|
386
|
-
|
387
363
|
end # Struct
|
388
364
|
|
389
365
|
class Except < Struct
|
390
|
-
|
391
366
|
def from_java(jex)
|
392
367
|
raise CORBA::BAD_PARAM.new('org.om.CORBA.UserException expected', 0, CORBA::COMPLETED_NO) unless jex.is_a?(CORBA::Native::UserException)
|
368
|
+
|
393
369
|
ex = get_type.new
|
394
|
-
members.each {|mname, mtc| ex.__send__("#{mname}=".to_sym, jex.__send__(mname.to_sym)) }
|
370
|
+
members.each { |mname, mtc| ex.__send__("#{mname}=".to_sym, jex.__send__(mname.to_sym)) }
|
395
371
|
ex
|
396
372
|
end
|
397
373
|
|
398
374
|
def is_compatible?(jex)
|
399
375
|
raise CORBA::BAD_PARAM.new('org.om.CORBA.UserException expected', 0, CORBA::COMPLETED_NO) unless jex.is_a?(CORBA::Native::UserException)
|
400
|
-
|
376
|
+
|
377
|
+
members.all? { |mname, mtc| jex.respond_to?(mname.to_sym) }
|
401
378
|
end
|
402
379
|
|
403
380
|
protected
|
@@ -409,11 +386,9 @@ module R2CORBA
|
|
409
386
|
CORBA::Exception.native2r($!)
|
410
387
|
end
|
411
388
|
end
|
412
|
-
|
413
389
|
end # Except
|
414
390
|
|
415
391
|
class Union < IdentifiedTypeCode
|
416
|
-
|
417
392
|
def initialize(*args)
|
418
393
|
if CORBA::Native::TypeCode === args.first
|
419
394
|
@tc_ = args.first
|
@@ -436,6 +411,7 @@ module R2CORBA
|
|
436
411
|
id, name, switchtype_, members_, type_, implicit_default_ = args
|
437
412
|
raise ::CORBA::BAD_PARAM unless members_.is_a? ::Array
|
438
413
|
raise ::CORBA::BAD_PARAM unless switchtype_.is_a?(CORBA::TypeCode)
|
414
|
+
|
439
415
|
@type = type_
|
440
416
|
@implicit_default = implicit_default_
|
441
417
|
@switchtype = switchtype_.resolved_tc
|
@@ -454,7 +430,7 @@ module R2CORBA
|
|
454
430
|
def tc_
|
455
431
|
@tc_ ||= begin
|
456
432
|
jmembers = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::UnionMember.java_class, @members.size)
|
457
|
-
@members.each_with_index {|(ml, mn, mt), i|
|
433
|
+
@members.each_with_index { |(ml, mn, mt), i|
|
458
434
|
if ml == :default
|
459
435
|
# label octet:0 means default label
|
460
436
|
jmembers[i] = CORBA::Native::UnionMember.new(mn, Any.to_any(0, CORBA._tc_octet).to_java, mt.tc_, nil)
|
@@ -475,21 +451,20 @@ module R2CORBA
|
|
475
451
|
CORBA::Exception.native2r($!)
|
476
452
|
end
|
477
453
|
end
|
478
|
-
|
479
454
|
end # Union
|
480
455
|
|
481
456
|
class Enum < IdentifiedTypeCode
|
482
|
-
|
483
457
|
def initialize(*args)
|
484
458
|
if CORBA::Native::TypeCode === args.first
|
485
459
|
@tc_ = args.first
|
486
460
|
@range = (0..@tc_.member_count).freeze
|
487
|
-
@members = @range.to_a.collect {|i| @tc_.member_name(i) }
|
461
|
+
@members = @range.to_a.collect { |i| @tc_.member_name(i) }
|
488
462
|
super(@tc_.id)
|
489
463
|
else
|
490
464
|
id, name, members_ = args
|
491
465
|
raise CORBA::BAD_PARAM unless members_.is_a? ::Array
|
492
|
-
|
466
|
+
|
467
|
+
@members = members_.collect { |m| m.to_s }
|
493
468
|
@range = (0...@members.size).freeze
|
494
469
|
begin
|
495
470
|
@tc_ = CORBA::ORB._orb.create_enum_tc(id.to_s, name.to_s, @members.to_java(:string))
|
@@ -499,7 +474,6 @@ module R2CORBA
|
|
499
474
|
super(id)
|
500
475
|
end
|
501
476
|
end
|
502
|
-
|
503
477
|
end # Enum
|
504
478
|
|
505
479
|
def TypeCode.get_primitive_tc(kind)
|
@@ -512,9 +486,7 @@ module R2CORBA
|
|
512
486
|
end
|
513
487
|
|
514
488
|
# final initialization
|
515
|
-
self._init
|
516
|
-
|
489
|
+
self._init
|
517
490
|
end # TypeCode
|
518
|
-
|
519
491
|
end ## module CORBA
|
520
492
|
end ## module R2CORBA
|
data/lib/corba/jbase/Values.rb
CHANGED
@@ -41,7 +41,7 @@ module R2CORBA
|
|
41
41
|
java_ex = jex.is_a?(Native::UserException) ? jex : jex.cause
|
42
42
|
exname = java_ex.class.name.split('::').last
|
43
43
|
tcs = CORBA::TypeCode.typecodes_for_name(exname) || []
|
44
|
-
extc = tcs.detect {|tc| tc.is_a?(TypeCode::Except) && tc.is_compatible?(java_ex)}
|
44
|
+
extc = tcs.detect { |tc| tc.is_a?(TypeCode::Except) && tc.is_compatible?(java_ex) }
|
45
45
|
if extc
|
46
46
|
ex = extc.from_java(java_ex)
|
47
47
|
ex.set_backtrace(jex.backtrace) if NativeException === jex
|
@@ -63,6 +63,7 @@ module R2CORBA
|
|
63
63
|
class SystemException
|
64
64
|
def self._raise(jex)
|
65
65
|
raise ArgumentError unless (NativeException === jex and jex.cause.is_a?(Native::SystemException)) or jex.is_a?(Native::SystemException)
|
66
|
+
|
66
67
|
java_ex = jex.is_a?(Native::SystemException) ? jex : jex.cause
|
67
68
|
exname = java_ex.class.name.split('::').last
|
68
69
|
exklass = CORBA.const_get(exname.to_sym)
|
data/lib/corba/jbase/poa.rb
CHANGED
@@ -18,10 +18,10 @@ module R2CORBA
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
require 'corba/common/Servant
|
22
|
-
require 'corba/idl/POAC
|
23
|
-
require 'corba/jbase/Servant
|
24
|
-
require 'corba/jbase/ServerRequest
|
21
|
+
require 'corba/common/Servant'
|
22
|
+
require 'corba/idl/POAC'
|
23
|
+
require 'corba/jbase/Servant'
|
24
|
+
require 'corba/jbase/ServerRequest'
|
25
25
|
|
26
26
|
module R2CORBA
|
27
27
|
module PortableServer
|
@@ -42,33 +42,33 @@ module R2CORBA
|
|
42
42
|
end
|
43
43
|
end # of operation destroy
|
44
44
|
|
45
|
-
def the_name
|
45
|
+
def the_name
|
46
46
|
begin
|
47
|
-
self.objref_.the_name
|
47
|
+
self.objref_.the_name
|
48
48
|
rescue ::NativeException
|
49
49
|
CORBA::Exception.native2r($!)
|
50
50
|
end
|
51
51
|
end # of attribute get_the_name
|
52
52
|
|
53
|
-
def the_POAManager
|
53
|
+
def the_POAManager
|
54
54
|
begin
|
55
|
-
PortableServer::POAManager._narrow(CORBA::Object._wrap_native(self.objref_.the_POAManager
|
55
|
+
PortableServer::POAManager._narrow(CORBA::Object._wrap_native(self.objref_.the_POAManager))
|
56
56
|
rescue ::NativeException
|
57
57
|
CORBA::Exception.native2r($!)
|
58
58
|
end
|
59
59
|
end # of attribute get_the_POAManager
|
60
60
|
|
61
|
-
def the_parent
|
61
|
+
def the_parent
|
62
62
|
begin
|
63
|
-
PortableServer::POA._narrow(CORBA::Object._wrap_native(self.objref_.the_parent
|
63
|
+
PortableServer::POA._narrow(CORBA::Object._wrap_native(self.objref_.the_parent))
|
64
64
|
rescue ::NativeException
|
65
65
|
CORBA::Exception.native2r($!)
|
66
66
|
end
|
67
67
|
end # of attribute get_the_parent
|
68
68
|
|
69
|
-
def the_children
|
69
|
+
def the_children
|
70
70
|
begin
|
71
|
-
self.objref_.the_children
|
71
|
+
self.objref_.the_children.collect { |c| PortableServer::POA._narrow(CORBA::Object._wrap_native(c)) }
|
72
72
|
rescue ::NativeException
|
73
73
|
CORBA::Exception.native2r($!)
|
74
74
|
end
|
@@ -164,9 +164,10 @@ module R2CORBA
|
|
164
164
|
|
165
165
|
def create_POA(adapter_name, a_POAManager, policies)
|
166
166
|
raise CORBA::BAD_PARAM.new('expected POAManager', 0, CORBA::COMPLETED_NO) unless a_POAManager.is_a?(PortableServer::POAManager)
|
167
|
+
|
167
168
|
CORBA::PolicyList._tc.validate(policies) unless policies.nil? || policies.empty?
|
168
169
|
jpolicies = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::Policy.java_class, policies.nil? ? 0 : policies.size)
|
169
|
-
policies.each_with_index {|p, i| jpolicies[i] = p.objref_ } unless policies.nil?
|
170
|
+
policies.each_with_index { |p, i| jpolicies[i] = p.objref_ } unless policies.nil?
|
170
171
|
begin
|
171
172
|
PortableServer::POA._narrow(CORBA::Object._wrap_native(self.objref_.create_POA(adapter_name, a_POAManager.objref_, jpolicies)))
|
172
173
|
rescue ::NativeException
|
@@ -184,9 +185,9 @@ module R2CORBA
|
|
184
185
|
end # POA
|
185
186
|
|
186
187
|
module POAManager
|
187
|
-
def activate
|
188
|
+
def activate
|
188
189
|
begin
|
189
|
-
self.objref_.activate
|
190
|
+
self.objref_.activate
|
190
191
|
rescue ::NativeException
|
191
192
|
CORBA::Exception.native2r($!)
|
192
193
|
end
|
@@ -216,9 +217,9 @@ module R2CORBA
|
|
216
217
|
end
|
217
218
|
end # deactivate
|
218
219
|
|
219
|
-
def get_state
|
220
|
+
def get_state
|
220
221
|
begin
|
221
|
-
self.objref_.get_state
|
222
|
+
self.objref_.get_state.value
|
222
223
|
rescue ::NativeException
|
223
224
|
CORBA::Exception.native2r($!)
|
224
225
|
end
|
data/lib/corba/jbase/policies.rb
CHANGED
@@ -11,12 +11,11 @@
|
|
11
11
|
#--------------------------------------------------------------------
|
12
12
|
|
13
13
|
module R2CORBA
|
14
|
-
|
15
14
|
module CORBA
|
16
|
-
|
17
15
|
module ORB
|
18
16
|
def create_policy(type, val)
|
19
17
|
raise CORBA::BAD_PARAM.new('Any expected', 0, CORBA::COMPLETED_NO) unless CORBA::Any === val
|
18
|
+
|
20
19
|
begin
|
21
20
|
Policy._wrap_native(self.orb_.create_policy(type.to_i, val.to_java(self.orb_)))
|
22
21
|
rescue ::NativeException
|
@@ -27,7 +26,8 @@ module R2CORBA
|
|
27
26
|
|
28
27
|
module Object
|
29
28
|
def _get_policy(policy_type)
|
30
|
-
raise CORBA::INV_OBJREF.new if self._is_nil?
|
29
|
+
raise CORBA::INV_OBJREF.new if self._is_nil?
|
30
|
+
|
31
31
|
begin
|
32
32
|
pol = Policy._wrap_native(self.objref_._get_policy(policy_type))
|
33
33
|
rescue ::NativeException
|
@@ -37,7 +37,8 @@ module R2CORBA
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def _get_policy_overrides(ts)
|
40
|
-
raise CORBA::INV_OBJREF.new if self._is_nil?
|
40
|
+
raise CORBA::INV_OBJREF.new if self._is_nil?
|
41
|
+
|
41
42
|
## currently JacORB does not support #_get_policy_overrides so we emulate it in that case
|
42
43
|
unless self.objref_.respond_to?(:_get_policy_overrides)
|
43
44
|
begin
|
@@ -51,14 +52,15 @@ module R2CORBA
|
|
51
52
|
rescue ::NativeException
|
52
53
|
CORBA::Exception.native2r($!)
|
53
54
|
end
|
54
|
-
jpolicies.collect {|jpol| Policy._wrap_native(jpol) }
|
55
|
+
jpolicies.collect { |jpol| Policy._wrap_native(jpol) }
|
55
56
|
end
|
56
57
|
end # of operation get_policy_overrides
|
57
58
|
|
58
59
|
def _set_policy_overrides(policies, set_add)
|
59
|
-
raise CORBA::INV_OBJREF.new if self._is_nil?
|
60
|
+
raise CORBA::INV_OBJREF.new if self._is_nil?
|
61
|
+
|
60
62
|
jpolicies = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::Policy.java_class, policies.size)
|
61
|
-
policies.each_with_index {|e, i| jpolicies[i] = e.objref_ }
|
63
|
+
policies.each_with_index { |e, i| jpolicies[i] = e.objref_ }
|
62
64
|
begin
|
63
65
|
obj = self.objref_._set_policy_override(jpolicies, Native::SetOverrideType.from_int(set_add))
|
64
66
|
rescue ::NativeException
|
@@ -80,30 +82,31 @@ module R2CORBA
|
|
80
82
|
module Policy
|
81
83
|
def self._wrap_native(jpol)
|
82
84
|
raise ArgumentError, 'Expected org.omg.CORBA.Policy' unless jpol.nil? || jpol.is_a?(Native::Policy)
|
85
|
+
|
83
86
|
Policy._narrow(CORBA::Object._wrap_native(jpol))
|
84
87
|
end
|
85
88
|
|
86
89
|
#------------------- "Policy Operations"
|
87
90
|
|
88
|
-
def policy_type
|
91
|
+
def policy_type
|
89
92
|
begin
|
90
|
-
self.objref_.policy_type
|
93
|
+
self.objref_.policy_type
|
91
94
|
rescue ::NativeException
|
92
95
|
CORBA::Exception.native2r($!)
|
93
96
|
end
|
94
97
|
end # of attribute get_policy_type
|
95
98
|
|
96
|
-
def copy
|
99
|
+
def copy
|
97
100
|
begin
|
98
|
-
Policy._wrap_native(self.objref_.copy
|
101
|
+
Policy._wrap_native(self.objref_.copy)
|
99
102
|
rescue ::NativeException
|
100
103
|
CORBA::Exception.native2r($!)
|
101
104
|
end
|
102
105
|
end # of operation copy
|
103
106
|
|
104
|
-
def destroy
|
107
|
+
def destroy
|
105
108
|
begin
|
106
|
-
self.objref_.destroy
|
109
|
+
self.objref_.destroy
|
107
110
|
rescue ::NativeException
|
108
111
|
CORBA::Exception.native2r($!)
|
109
112
|
end
|
@@ -120,12 +123,12 @@ module R2CORBA
|
|
120
123
|
rescue ::NativeException
|
121
124
|
CORBA::Exception.native2r($!)
|
122
125
|
end
|
123
|
-
jpolicies.collect {|jpol| Policy._wrap_native(jpol) }
|
126
|
+
jpolicies.collect { |jpol| Policy._wrap_native(jpol) }
|
124
127
|
end # of operation get_policy_overrides
|
125
128
|
|
126
129
|
def set_policy_overrides(policies, set_add)
|
127
130
|
jpolicies = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::Policy.java_class, policies.size)
|
128
|
-
policies.each_with_index {|e, i| jpolicies[i] = e.objref_ }
|
131
|
+
policies.each_with_index { |e, i| jpolicies[i] = e.objref_ }
|
129
132
|
begin
|
130
133
|
self.objref_.set_policy_overrides(jpolicies, Native::SetOverrideType.from_int(set_add))
|
131
134
|
rescue ::NativeException
|
@@ -133,11 +136,9 @@ module R2CORBA
|
|
133
136
|
end
|
134
137
|
end # of operation set_policy_overrides
|
135
138
|
end # Policy
|
136
|
-
|
137
139
|
end # CORBA
|
138
140
|
|
139
141
|
module PortableServer
|
140
|
-
|
141
142
|
module POA
|
142
143
|
def create_thread_policy(value)
|
143
144
|
begin
|
@@ -210,90 +211,86 @@ module R2CORBA
|
|
210
211
|
end # of operation create_request_processing_policy
|
211
212
|
end # POA
|
212
213
|
|
213
|
-
module ThreadPolicy
|
214
|
-
def value
|
214
|
+
module ThreadPolicy ## interface
|
215
|
+
def value
|
215
216
|
begin
|
216
|
-
self.objref_.value
|
217
|
+
self.objref_.value.value
|
217
218
|
rescue ::NativeException
|
218
219
|
CORBA::Exception.native2r($!)
|
219
220
|
end
|
220
221
|
end # of attribute get_value
|
221
222
|
end # of interface ThreadPolicy
|
222
223
|
|
223
|
-
module LifespanPolicy
|
224
|
-
def value
|
224
|
+
module LifespanPolicy ## interface
|
225
|
+
def value
|
225
226
|
begin
|
226
|
-
self.objref_.value
|
227
|
+
self.objref_.value.value
|
227
228
|
rescue ::NativeException
|
228
229
|
CORBA::Exception.native2r($!)
|
229
230
|
end
|
230
231
|
end # of attribute get_value
|
231
232
|
end # of interface LifespanPolicy
|
232
233
|
|
233
|
-
module IdUniquenessPolicy
|
234
|
-
def value
|
234
|
+
module IdUniquenessPolicy ## interface
|
235
|
+
def value
|
235
236
|
begin
|
236
|
-
self.objref_.value
|
237
|
+
self.objref_.value.value
|
237
238
|
rescue ::NativeException
|
238
239
|
CORBA::Exception.native2r($!)
|
239
240
|
end
|
240
241
|
end # of attribute get_value
|
241
242
|
end # of interface IdUniquenessPolicy
|
242
243
|
|
243
|
-
module IdAssignmentPolicy
|
244
|
-
def value
|
244
|
+
module IdAssignmentPolicy ## interface
|
245
|
+
def value
|
245
246
|
begin
|
246
|
-
self.objref_.value
|
247
|
+
self.objref_.value.value
|
247
248
|
rescue ::NativeException
|
248
249
|
CORBA::Exception.native2r($!)
|
249
250
|
end
|
250
251
|
end # of attribute get_value
|
251
252
|
end # of interface IdAssignmentPolicy
|
252
253
|
|
253
|
-
module ImplicitActivationPolicy
|
254
|
-
def value
|
254
|
+
module ImplicitActivationPolicy ## interface
|
255
|
+
def value
|
255
256
|
begin
|
256
|
-
self.objref_.value
|
257
|
+
self.objref_.value.value
|
257
258
|
rescue ::NativeException
|
258
259
|
CORBA::Exception.native2r($!)
|
259
260
|
end
|
260
261
|
end # of attribute get_value
|
261
262
|
end # of interface ImplicitActivationPolicy
|
262
263
|
|
263
|
-
module ServantRetentionPolicy
|
264
|
-
def value
|
264
|
+
module ServantRetentionPolicy ## interface
|
265
|
+
def value
|
265
266
|
begin
|
266
|
-
self.objref_.value
|
267
|
+
self.objref_.value.value
|
267
268
|
rescue ::NativeException
|
268
269
|
CORBA::Exception.native2r($!)
|
269
270
|
end
|
270
271
|
end # of attribute get_value
|
271
272
|
end # of interface RequestProcessingPolicy
|
272
273
|
|
273
|
-
module RequestProcessingPolicy
|
274
|
-
def value
|
274
|
+
module RequestProcessingPolicy ## interface
|
275
|
+
def value
|
275
276
|
begin
|
276
|
-
self.objref_.value
|
277
|
+
self.objref_.value.value
|
277
278
|
rescue ::NativeException
|
278
279
|
CORBA::Exception.native2r($!)
|
279
280
|
end
|
280
281
|
end # of attribute get_value
|
281
282
|
end # of interface RequestProcessingPolicy
|
282
|
-
|
283
283
|
end # PortableServer
|
284
284
|
|
285
285
|
module BiDirPolicy
|
286
|
-
|
287
|
-
|
288
|
-
def value()
|
286
|
+
module BidirectionalPolicy ## interface
|
287
|
+
def value
|
289
288
|
begin
|
290
|
-
self.objref_.value
|
289
|
+
self.objref_.value.value
|
291
290
|
rescue ::NativeException
|
292
291
|
CORBA::Exception.native2r($!)
|
293
292
|
end
|
294
293
|
end # of attribute get_value
|
295
294
|
end # of interface BidirectionalPolicy
|
296
|
-
|
297
295
|
end # BiDirPolicy
|
298
|
-
|
299
296
|
end # R2CORBA
|
data/lib/corba/jbase/require.rb
CHANGED
@@ -15,11 +15,11 @@ require 'java'
|
|
15
15
|
module R2CORBA
|
16
16
|
if ENV['JACORB_HOME'] &&
|
17
17
|
(File.exist?(File.join(ENV['JACORB_HOME'], 'lib', 'jacorb.jar')) ||
|
18
|
-
Dir[File.join(ENV['JACORB_HOME'], 'lib', 'jacorb-*.jar')].any? {|p| p =~ /\/jacorb\-\d\.\d\.jar\Z/})
|
18
|
+
Dir[File.join(ENV['JACORB_HOME'], 'lib', 'jacorb-*.jar')].any? { |p| p =~ /\/jacorb\-\d\.\d\.jar\Z/ })
|
19
19
|
JACORB_HOME = ENV['JACORB_HOME']
|
20
20
|
else
|
21
21
|
# find jacorb.jar in library search path
|
22
|
-
JACORB_HOME = File.dirname(($:.find { |path| Dir[File.join(path, 'jacorb-*.jar')].any? {|p| p =~ /\/jacorb(\.jar|\-\d\.\d\.jar)\Z/} }).to_s)
|
22
|
+
JACORB_HOME = File.dirname(($:.find { |path| Dir[File.join(path, 'jacorb-*.jar')].any? { |p| p =~ /\/jacorb(\.jar|\-\d\.\d\.jar)\Z/ } }).to_s)
|
23
23
|
end
|
24
24
|
|
25
25
|
$LOAD_PATH << File.join(JACORB_HOME, 'lib')
|
@@ -80,7 +80,7 @@ module R2CORBA
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
[
|
83
|
+
['exception',
|
84
84
|
'Object',
|
85
85
|
'ORB',
|
86
86
|
'Request',
|