r2corba 1.5.4 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -2
- data/ext/libr2tao/any.cpp +11 -10
- data/ext/libr2tao/exception.cpp +6 -8
- data/ext/libr2tao/exception.h +1 -1
- data/ext/libr2tao/longdouble.cpp +5 -9
- data/ext/libr2tao/object.cpp +37 -53
- data/ext/libr2tao/orb.cpp +46 -73
- data/ext/libr2tao/r2tao_ext.h +8 -19
- data/ext/libr2tao/required.cpp +3 -8
- data/ext/libr2tao/required.h +18 -34
- data/ext/libr2tao/values.cpp +97 -98
- data/ext/libr2tao/values.h +35 -37
- data/ext/librpoa/iortable.cpp +6 -7
- data/ext/librpoa/poa.cpp +29 -32
- data/ext/librpoa/servant.cpp +39 -113
- data/ext/librpoa/servant.h +18 -40
- data/lib/corba/cbase/ORB.rb +26 -23
- data/lib/corba/cbase/Request.rb +3 -3
- data/lib/corba/cbase/Streams.rb +2 -2
- data/lib/corba/cbase/Typecode.rb +6 -6
- data/lib/corba/cbase/Values.rb +4 -2
- data/lib/corba/cbase/exception.rb +6 -4
- data/lib/corba/cbase/poa.rb +1 -1
- data/lib/corba/cbase/policies.rb +2 -2
- data/lib/corba/cbase/require.rb +8 -1
- data/lib/corba/cmds/base.rb +1 -1
- data/lib/corba/common/Any.rb +3 -2
- data/lib/corba/common/IDL.rb +1 -1
- data/lib/corba/common/ORB.rb +22 -22
- data/lib/corba/common/Object.rb +14 -14
- data/lib/corba/common/Servant.rb +4 -4
- data/lib/corba/common/Stub.rb +6 -6
- data/lib/corba/common/Typecode.rb +69 -42
- data/lib/corba/common/Union.rb +5 -0
- data/lib/corba/common/Values.rb +1 -0
- data/lib/corba/common/const.rb +2 -2
- data/lib/corba/common/exception.rb +2 -1
- data/lib/corba/common/version.rb +2 -2
- data/lib/corba/idl/IDL.rb +1 -1
- data/lib/corba/jbase/Any.rb +28 -26
- data/lib/corba/jbase/ORB.rb +5 -5
- data/lib/corba/jbase/Object.rb +13 -13
- data/lib/corba/jbase/Request.rb +8 -8
- data/lib/corba/jbase/Servant.rb +10 -10
- data/lib/corba/jbase/ServerRequest.rb +7 -7
- data/lib/corba/jbase/Streams.rb +67 -3
- data/lib/corba/jbase/Typecode.rb +17 -16
- data/lib/corba/jbase/Values.rb +2 -0
- data/lib/corba/jbase/exception.rb +2 -1
- data/lib/corba/jbase/poa.rb +20 -20
- data/lib/corba/jbase/policies.rb +32 -32
- data/lib/corba/jbase/require.rb +4 -0
- data/lib/corba/poa.rb +1 -1
- data/lib/corba/policies.rb +1 -1
- data/lib/corba/require.rb +2 -2
- data/lib/corba/svcs/ins/cos_naming.rb +37 -28
- data/lib/corba/svcs/ins/ins.rb +51 -51
- data/lib/corba/svcs/ins/naming_service.rb +8 -8
- data/lib/corba.rb +1 -1
- data/lib/ridlbe/ruby/config.rb +37 -30
- data/lib/ridlbe/ruby/walker.rb +295 -272
- data/mkrf_conf_srcgem.rb +6 -6
- data/rakelib/bin.rake +1 -1
- data/rakelib/bin.rb +3 -3
- data/rakelib/build.rake +16 -16
- data/rakelib/config.rake +1 -1
- data/rakelib/config.rb +22 -22
- data/rakelib/ext.rake +7 -68
- data/rakelib/ext.rb +15 -15
- data/rakelib/ext_r2tao.rb +12 -55
- data/rakelib/gem.rake +25 -25
- data/rakelib/gem.rb +6 -6
- data/rakelib/package.rake +1 -1
- data/test/BiDirectional/client.rb +17 -17
- data/test/BiDirectional/run_test.rb +11 -11
- data/test/BiDirectional/server.rb +24 -25
- data/test/CORBA_Services/Naming/BindingIterator/client.rb +17 -17
- data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +13 -13
- data/test/CORBA_Services/Naming/BindingIterator/server.rb +19 -19
- data/test/CORBA_Services/Naming/Corbaname/client.rb +15 -15
- data/test/CORBA_Services/Naming/Corbaname/run_test.rb +13 -13
- data/test/CORBA_Services/Naming/Corbaname/server.rb +30 -30
- data/test/CORBA_Services/Naming/Simple/client.rb +16 -16
- data/test/CORBA_Services/Naming/Simple/run_test.rb +13 -13
- data/test/CORBA_Services/Naming/Simple/server.rb +19 -19
- data/test/Collocation/run_test.rb +10 -10
- data/test/Collocation/test.rb +27 -20
- data/test/Connect_Timeout/client.rb +16 -17
- data/test/Connect_Timeout/run_test.rb +10 -10
- data/test/DII/client.rb +30 -30
- data/test/DII/run_test.rb +11 -11
- data/test/DII/server.rb +16 -16
- data/test/DSI/client.rb +16 -16
- data/test/DSI/run_test.rb +11 -11
- data/test/DSI/server.rb +17 -17
- data/test/Exceptions/client.rb +21 -21
- data/test/Exceptions/run_test.rb +11 -11
- data/test/Exceptions/server.rb +16 -16
- data/test/Hello/client.rb +16 -16
- data/test/Hello/run_test.rb +11 -11
- data/test/Hello/server.rb +17 -17
- data/test/IDL_Test/client.rb +21 -21
- data/test/IDL_Test/run_test.rb +11 -11
- data/test/IDL_Test/server.rb +19 -19
- data/test/IORMap/client.rb +14 -14
- data/test/IORMap/run_test.rb +11 -11
- data/test/IORMap/server.rb +26 -26
- data/test/IORTable/client.rb +14 -14
- data/test/IORTable/run_test.rb +11 -11
- data/test/IORTable/server.rb +26 -26
- data/test/Implicit_Conversion/client.rb +20 -17
- data/test/Implicit_Conversion/run_test.rb +11 -11
- data/test/Implicit_Conversion/server.rb +16 -16
- data/test/Multi_Threading/Multiple_ORB/client.rb +14 -14
- data/test/Multi_Threading/Multiple_ORB/run_test.rb +12 -12
- data/test/Multi_Threading/Multiple_ORB/server.rb +17 -17
- data/test/Multi_Threading/Simple/client.rb +17 -17
- data/test/Multi_Threading/Simple/run_test.rb +11 -11
- data/test/Multi_Threading/Simple/server.rb +16 -16
- data/test/Multi_Threading/Threads/client.rb +16 -16
- data/test/Multi_Threading/Threads/run_test.rb +11 -11
- data/test/Multi_Threading/Threads/server.rb +22 -22
- data/test/Multi_Threading/Threads/watchdog.rb +16 -16
- data/test/Multiple_Servant_Interfaces/client.rb +14 -14
- data/test/Multiple_Servant_Interfaces/run_test.rb +11 -11
- data/test/Multiple_Servant_Interfaces/server.rb +18 -18
- data/test/Nil/run_test.rb +10 -10
- data/test/Nil/test.rb +14 -15
- data/test/OBV/AbstractInterface/client.rb +14 -14
- data/test/OBV/AbstractInterface/run_test.rb +11 -11
- data/test/OBV/AbstractInterface/server.rb +20 -19
- data/test/OBV/Custom/OBV_impl.rb +2 -0
- data/test/OBV/Custom/client.rb +14 -14
- data/test/OBV/Custom/run_test.rb +11 -11
- data/test/OBV/Custom/server.rb +16 -16
- data/test/OBV/Simple/OBV_impl.rb +1 -0
- data/test/OBV/Simple/client.rb +14 -14
- data/test/OBV/Simple/run_test.rb +11 -11
- data/test/OBV/Simple/server.rb +16 -16
- data/test/OBV/Simple_Event/Event_impl.rb +1 -0
- data/test/OBV/Simple_Event/client.rb +14 -14
- data/test/OBV/Simple_Event/run_test.rb +11 -11
- data/test/OBV/Simple_Event/server.rb +16 -16
- data/test/OBV/Supports/client.rb +19 -19
- data/test/OBV/Supports/run_test.rb +11 -11
- data/test/OBV/Supports/server.rb +15 -15
- data/test/OBV/Supports/supports_impl.rb +3 -0
- data/test/OBV/Tree/client.rb +14 -14
- data/test/OBV/Tree/run_test.rb +11 -11
- data/test/OBV/Tree/server.rb +19 -19
- data/test/OBV/Truncatable/Truncatable_impl.rb +1 -1
- data/test/OBV/Truncatable/client.rb +57 -57
- data/test/OBV/Truncatable/run_test.rb +11 -11
- data/test/OBV/Truncatable/server.rb +15 -15
- data/test/OBV/ValueBox/client.rb +154 -153
- data/test/OBV/ValueBox/run_test.rb +11 -11
- data/test/OBV/ValueBox/server.rb +42 -42
- data/test/Object/client.rb +15 -15
- data/test/Object/run_test.rb +11 -11
- data/test/Object/server.rb +19 -19
- data/test/POA/run_test.rb +10 -10
- data/test/POA/test.rb +16 -16
- data/test/Param_Test/client.rb +51 -51
- data/test/Param_Test/run_test.rb +11 -11
- data/test/Param_Test/server.rb +59 -59
- data/test/Performance/Simple/client.rb +16 -16
- data/test/Performance/Simple/run_test.rb +11 -11
- data/test/Performance/Simple/server.rb +16 -16
- data/test/Policies/run_test.rb +10 -10
- data/test/Policies/test.rb +23 -24
- data/test/Timeout/client.rb +21 -21
- data/test/Timeout/run_test.rb +11 -11
- data/test/Timeout/server.rb +22 -22
- data/test/lib/assert.rb +0 -1
- data/test/lib/test.rb +28 -23
- data/test/test_runner.rb +21 -22
- metadata +6 -9
- data/ext/extload/extload.c +0 -60
- data/ext/librpoa/srvreq_fix.cpp +0 -282
- data/ext/librpoa/srvreq_fix.h +0 -148
data/test/test_runner.rb
CHANGED
@@ -19,7 +19,7 @@ else
|
|
19
19
|
RB_CONFIG = Config::CONFIG
|
20
20
|
end
|
21
21
|
|
22
|
-
is_win32 = (RB_CONFIG['target_os'] =~ /win32/ || RB_CONFIG['target_os'] =~ /
|
22
|
+
is_win32 = (RB_CONFIG['target_os'] =~ /win32/ || RB_CONFIG['target_os'] =~ /mingw/) ? true : false
|
23
23
|
|
24
24
|
root_path = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
25
25
|
|
@@ -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(
|
52
|
+
File.directory?(ace_root) ? File.join(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(
|
58
|
+
File.directory?(ace_root) ? File.join(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(
|
62
|
+
File.directory?(ace_root) ? File.join(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(
|
68
|
+
File.directory?(ace_root) ? File.join(ace_root, 'lib') : nil,
|
69
69
|
ENV['LD_LIBRARY_PATH']
|
70
70
|
].compact.join(File::PATH_SEPARATOR)
|
71
71
|
end
|
@@ -126,7 +126,7 @@ module TestFinder
|
|
126
126
|
puts dir
|
127
127
|
end
|
128
128
|
else
|
129
|
-
Dir.glob(File.join(path,
|
129
|
+
Dir.glob(File.join(path, '*')) {|psub| self.process_directory(psub)}
|
130
130
|
end
|
131
131
|
end
|
132
132
|
end
|
@@ -136,25 +136,25 @@ module TestFinder
|
|
136
136
|
script_name = File.basename($0)
|
137
137
|
opts.banner = "Usage: #{script_name} #{/r2corba/ =~ script_name ? 'test ' : nil}[options]"
|
138
138
|
|
139
|
-
opts.separator
|
139
|
+
opts.separator ''
|
140
140
|
|
141
|
-
opts.on(
|
142
|
-
|
143
|
-
|
144
|
-
opts.on(
|
145
|
-
|
146
|
-
|
141
|
+
opts.on('-x MATCH', '--exclude=MATCH',
|
142
|
+
'Do not run tests matching MATCH.',
|
143
|
+
'Default: nil') { |v| (OPTIONS[:exclude] ||= []) << v.to_s }
|
144
|
+
opts.on('-r MATCH', '--run=MATCH',
|
145
|
+
'Only run tests matching MATCH.',
|
146
|
+
'Default: nil (run all)') { |v| (OPTIONS[:runonly] ||= []) << v.to_s }
|
147
147
|
opts.on('-l', '--list',
|
148
148
|
'List tests, do not run.',
|
149
|
-
|
150
|
-
opts.on(
|
151
|
-
|
149
|
+
'Default: off') { OPTIONS[:listonly] = true }
|
150
|
+
opts.on('-d',
|
151
|
+
'Run with debugging output.',
|
152
152
|
"Default: ENV['R2CORBA_DEBUG'].nil? ? false : true") { OPTIONS[:debug] = true }
|
153
153
|
|
154
|
-
opts.separator
|
154
|
+
opts.separator ''
|
155
155
|
|
156
|
-
opts.on(
|
157
|
-
|
156
|
+
opts.on('-h', '--help',
|
157
|
+
'Show this help message.') { puts opts; exit }
|
158
158
|
|
159
159
|
opts.parse!(argv)
|
160
160
|
|
@@ -170,7 +170,7 @@ module TestFinder
|
|
170
170
|
end
|
171
171
|
|
172
172
|
if OPTIONS[:runonly].nil?
|
173
|
-
Dir.glob(File.join(TestFinder::ROOT,
|
173
|
+
Dir.glob(File.join(TestFinder::ROOT, '*')) do |p|
|
174
174
|
TestFinder.process_directory(p)
|
175
175
|
end
|
176
176
|
else
|
@@ -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.
|
4
|
+
version: 1.6.1
|
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:
|
12
|
+
date: 2022-03-03 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.
|
@@ -58,7 +58,6 @@ files:
|
|
58
58
|
- bin/ridlc
|
59
59
|
- bin/rins
|
60
60
|
- ext/ext.mwc
|
61
|
-
- ext/extload/extload.c
|
62
61
|
- ext/libr2tao/any.cpp
|
63
62
|
- ext/libr2tao/exception.cpp
|
64
63
|
- ext/libr2tao/exception.h
|
@@ -82,8 +81,6 @@ files:
|
|
82
81
|
- ext/librpoa/rpoa_export.h
|
83
82
|
- ext/librpoa/servant.cpp
|
84
83
|
- ext/librpoa/servant.h
|
85
|
-
- ext/librpoa/srvreq_fix.cpp
|
86
|
-
- ext/librpoa/srvreq_fix.h
|
87
84
|
- ext/librpol/policies.cpp
|
88
85
|
- ext/librpol/policies.h
|
89
86
|
- ext/librpol/rpol_export.h
|
@@ -321,14 +318,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
321
318
|
requirements:
|
322
319
|
- - ">="
|
323
320
|
- !ruby/object:Gem::Version
|
324
|
-
version: '2.
|
321
|
+
version: '2.4'
|
325
322
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
326
323
|
requirements:
|
327
324
|
- - ">="
|
328
325
|
- !ruby/object:Gem::Version
|
329
326
|
version: '0'
|
330
327
|
requirements: []
|
331
|
-
rubygems_version: 3.1.
|
328
|
+
rubygems_version: 3.1.6
|
332
329
|
signing_key:
|
333
330
|
specification_version: 4
|
334
331
|
summary: CORBA language mapping implementation for Ruby
|
data/ext/extload/extload.c
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
|
2
|
-
#include <windows.h>
|
3
|
-
#include <string.h>
|
4
|
-
#include <stdio.h>
|
5
|
-
|
6
|
-
static TCHAR szModulePath[MAX_PATH+1] = {0};
|
7
|
-
static TCHAR *pszPathEnd = 0;
|
8
|
-
|
9
|
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
10
|
-
{
|
11
|
-
(void)lpvReserved;
|
12
|
-
size_t len;
|
13
|
-
|
14
|
-
if (fdwReason == DLL_PROCESS_ATTACH)
|
15
|
-
{
|
16
|
-
GetModuleFileName(hinstDLL, &szModulePath[0], MAX_PATH);
|
17
|
-
/* find last path separator and cut off path to get foldername incl. last separator */
|
18
|
-
len = strlen (&szModulePath[0]);
|
19
|
-
while (len > 0 && szModulePath[--len] != '\\') ;
|
20
|
-
pszPathEnd = &szModulePath[len+1];
|
21
|
-
*pszPathEnd = '\0';
|
22
|
-
}
|
23
|
-
return TRUE;
|
24
|
-
}
|
25
|
-
|
26
|
-
typedef void (WINAPI *TExtInit)(void);
|
27
|
-
|
28
|
-
#define DEF_EXTENSION_INIT(LIBNAME) \
|
29
|
-
__declspec (dllexport) void Init_ ## LIBNAME ## w() \
|
30
|
-
{ \
|
31
|
-
const char *pszLibName; \
|
32
|
-
HMODULE hlib; \
|
33
|
-
TExtInit pfInit; \
|
34
|
-
\
|
35
|
-
pszLibName = #LIBNAME ".so"; \
|
36
|
-
strcat (&szModulePath[0], pszLibName); \
|
37
|
-
if (NULL == (hlib = LoadLibraryEx(szModulePath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH))) \
|
38
|
-
{ \
|
39
|
-
*pszPathEnd = '\0'; \
|
40
|
-
strcat (&szModulePath[0], #LIBNAME "\\"); \
|
41
|
-
strcat (&szModulePath[0], pszLibName); \
|
42
|
-
if (NULL == (hlib = LoadLibraryEx(szModulePath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH))) \
|
43
|
-
{ \
|
44
|
-
printf("ERROR: extload failed to load %s\n", #LIBNAME); \
|
45
|
-
return; \
|
46
|
-
} \
|
47
|
-
} \
|
48
|
-
if (NULL == (pfInit = (TExtInit) GetProcAddress(hlib, "Init_" #LIBNAME))) \
|
49
|
-
{ \
|
50
|
-
printf("ERROR: extload failed to retrieve init proc %s from lib %s\n", "Init_" #LIBNAME, #LIBNAME); \
|
51
|
-
return; \
|
52
|
-
} \
|
53
|
-
pfInit (); \
|
54
|
-
}
|
55
|
-
|
56
|
-
DEF_EXTENSION_INIT(libr2tao)
|
57
|
-
|
58
|
-
DEF_EXTENSION_INIT(librpoa)
|
59
|
-
|
60
|
-
DEF_EXTENSION_INIT(librpol)
|
data/ext/librpoa/srvreq_fix.cpp
DELETED
@@ -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
|
data/ext/librpoa/srvreq_fix.h
DELETED
@@ -1,148 +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_H__
|
14
|
-
#define __SRVREQ_FIX_H__
|
15
|
-
|
16
|
-
#include "tao/TAO_Server_Request.h"
|
17
|
-
#include "tao/CDR.h"
|
18
|
-
#include "ace/Atomic_Op.h"
|
19
|
-
|
20
|
-
namespace R2CORBA
|
21
|
-
{
|
22
|
-
class ServerRequest;
|
23
|
-
typedef ServerRequest *ServerRequest_ptr;
|
24
|
-
|
25
|
-
typedef TAO_Pseudo_Var_T<ServerRequest> ServerRequest_var;
|
26
|
-
typedef TAO_Pseudo_Out_T<ServerRequest> ServerRequest_out;
|
27
|
-
|
28
|
-
/**
|
29
|
-
* @class ServerRequest
|
30
|
-
*
|
31
|
-
* @brief Class representing the CORBA ServerRequest pseudo-object.
|
32
|
-
*
|
33
|
-
* R2CORBA fixed version for older (< 6.0.2) TAO versions
|
34
|
-
*/
|
35
|
-
class ServerRequest
|
36
|
-
{
|
37
|
-
public:
|
38
|
-
ServerRequest (TAO_ServerRequest &orb_server_request);
|
39
|
-
|
40
|
-
~ServerRequest (void);
|
41
|
-
|
42
|
-
void arguments (CORBA::NVList_ptr &list);
|
43
|
-
|
44
|
-
void set_result (const CORBA::Any &value);
|
45
|
-
|
46
|
-
void set_exception (const CORBA::Any &value);
|
47
|
-
|
48
|
-
void dsi_marshal (void);
|
49
|
-
|
50
|
-
CORBA::Context_ptr ctx (void) const;
|
51
|
-
|
52
|
-
void ctx (CORBA::Context_ptr);
|
53
|
-
|
54
|
-
const char *operation (void) const;
|
55
|
-
|
56
|
-
static ServerRequest_ptr _duplicate (ServerRequest_ptr);
|
57
|
-
static ServerRequest_ptr _nil (void);
|
58
|
-
|
59
|
-
CORBA::ULong _incr_refcount (void);
|
60
|
-
CORBA::ULong _decr_refcount (void);
|
61
|
-
|
62
|
-
void _tao_lazy_evaluation (bool lazy_evaluation);
|
63
|
-
|
64
|
-
int _tao_incoming_byte_order (void) const;
|
65
|
-
|
66
|
-
void _tao_reply_byte_order (int byte_order);
|
67
|
-
|
68
|
-
TAO_ServerRequest & _tao_server_request (void);
|
69
|
-
|
70
|
-
void gateway_exception_reply (ACE_CString &raw_exception);
|
71
|
-
|
72
|
-
typedef R2CORBA::ServerRequest_ptr _ptr_type;
|
73
|
-
typedef R2CORBA::ServerRequest_var _var_type;
|
74
|
-
typedef R2CORBA::ServerRequest_out _out_type;
|
75
|
-
|
76
|
-
private:
|
77
|
-
bool lazy_evaluation_;
|
78
|
-
CORBA::Context_ptr ctx_;
|
79
|
-
CORBA::NVList_ptr params_;
|
80
|
-
CORBA::Any_ptr retval_;
|
81
|
-
CORBA::Any_ptr exception_;
|
82
|
-
ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
|
83
|
-
TAO_ServerRequest &orb_server_request_;
|
84
|
-
bool sent_gateway_exception_;
|
85
|
-
};
|
86
|
-
} // End R2CORBA namespace
|
87
|
-
|
88
|
-
inline R2CORBA::ServerRequest_ptr
|
89
|
-
R2CORBA::ServerRequest::_duplicate (R2CORBA::ServerRequest_ptr x)
|
90
|
-
{
|
91
|
-
if (x != 0)
|
92
|
-
{
|
93
|
-
x->_incr_refcount ();
|
94
|
-
}
|
95
|
-
|
96
|
-
return x;
|
97
|
-
}
|
98
|
-
|
99
|
-
inline R2CORBA::ServerRequest_ptr
|
100
|
-
R2CORBA::ServerRequest::_nil (void)
|
101
|
-
{
|
102
|
-
return static_cast <R2CORBA::ServerRequest_ptr>(0);
|
103
|
-
}
|
104
|
-
|
105
|
-
inline CORBA::Context_ptr
|
106
|
-
R2CORBA::ServerRequest::ctx (void) const
|
107
|
-
{
|
108
|
-
return this->ctx_;
|
109
|
-
}
|
110
|
-
|
111
|
-
inline void
|
112
|
-
R2CORBA::ServerRequest::ctx (CORBA::Context_ptr ctx)
|
113
|
-
{
|
114
|
-
this->ctx_ = ctx;
|
115
|
-
}
|
116
|
-
|
117
|
-
inline const char *
|
118
|
-
R2CORBA::ServerRequest::operation (void) const
|
119
|
-
{
|
120
|
-
return this->orb_server_request_.operation ();
|
121
|
-
}
|
122
|
-
|
123
|
-
inline void
|
124
|
-
R2CORBA::ServerRequest::_tao_lazy_evaluation (bool lazy_evaluation)
|
125
|
-
{
|
126
|
-
this->lazy_evaluation_ = lazy_evaluation;
|
127
|
-
}
|
128
|
-
|
129
|
-
inline int
|
130
|
-
R2CORBA::ServerRequest::_tao_incoming_byte_order (void) const
|
131
|
-
{
|
132
|
-
return this->orb_server_request_.incoming ()->byte_order ();
|
133
|
-
}
|
134
|
-
|
135
|
-
inline void
|
136
|
-
R2CORBA::ServerRequest::_tao_reply_byte_order (int byte_order)
|
137
|
-
{
|
138
|
-
this->orb_server_request_.outgoing ()->reset_byte_order (byte_order);
|
139
|
-
}
|
140
|
-
|
141
|
-
|
142
|
-
inline TAO_ServerRequest &
|
143
|
-
R2CORBA::ServerRequest::_tao_server_request (void)
|
144
|
-
{
|
145
|
-
return this->orb_server_request_;
|
146
|
-
}
|
147
|
-
|
148
|
-
#endif
|