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