r2corba 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- 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,763 @@
|
|
1
|
+
/*--------------------------------------------------------------------
|
2
|
+
# policies.cpp - R2TAO CORBA Policies 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
|
+
#include "policies.h"
|
15
|
+
#include "rpol_export.h"
|
16
|
+
#include "orb.h"
|
17
|
+
#include "exception.h"
|
18
|
+
#include "object.h"
|
19
|
+
#include "typecode.h"
|
20
|
+
#include "poa.h"
|
21
|
+
#include "tao/corba.h"
|
22
|
+
#include "tao/ORB_Core.h"
|
23
|
+
#include "tao/AnyTypeCode/Any.h"
|
24
|
+
#include "tao/BiDir_GIOP/BiDirGIOP.h"
|
25
|
+
#include "tao/Messaging/Messaging.h"
|
26
|
+
|
27
|
+
static VALUE r2tao_nsPolicy = 0;
|
28
|
+
static VALUE r2tao_nsPolicyManager = 0;
|
29
|
+
static VALUE r2tao_nsPolicyCurrent = 0;
|
30
|
+
static VALUE r2tao_nsThreadPolicy;
|
31
|
+
static VALUE r2tao_nsLifespanPolicy;
|
32
|
+
static VALUE r2tao_nsIdAssignmentPolicy;
|
33
|
+
static VALUE r2tao_nsIdUniquenessPolicy;
|
34
|
+
static VALUE r2tao_nsImplicitActivationPolicy;
|
35
|
+
static VALUE r2tao_nsServantRetentionPolicy;
|
36
|
+
static VALUE r2tao_nsRequestProcessingPolicy;
|
37
|
+
|
38
|
+
static VALUE r2tao_x_PolicyError;
|
39
|
+
static VALUE r2tao_x_InvalidPolicies;
|
40
|
+
|
41
|
+
static ID validate_ID;
|
42
|
+
|
43
|
+
static R2TAO_RBFuncall FN_narrow ("_narrow");
|
44
|
+
|
45
|
+
/* orb */
|
46
|
+
static VALUE rCORBA_ORB_create_policy(VALUE self, VALUE identifier, VALUE any);
|
47
|
+
|
48
|
+
/* Policy */
|
49
|
+
static CORBA::Policy_ptr r2tao_Policy_r2t(VALUE obj);
|
50
|
+
|
51
|
+
static VALUE r2tao_Policy_destroy(VALUE self);
|
52
|
+
static VALUE r2tao_Policy_type(VALUE self);
|
53
|
+
static VALUE r2tao_Policy_copy(VALUE self);
|
54
|
+
|
55
|
+
static VALUE r2tao_Object_get_policy(VALUE self, VALUE ptype);
|
56
|
+
static VALUE r2tao_Object_get_policy_overrides(VALUE self, VALUE ptseq);
|
57
|
+
static VALUE r2tao_Object_set_policy_overrides(VALUE self, VALUE policies, VALUE set_or_add);
|
58
|
+
static VALUE r2tao_Object_validate_connection(VALUE self, VALUE inconsistent_pol_out);
|
59
|
+
|
60
|
+
static VALUE r2tao_PolicyManager_get_policy_overrides(VALUE self, VALUE ptseq);
|
61
|
+
static VALUE r2tao_PolicyManager_set_policy_overrides(VALUE self, VALUE policies, VALUE set_or_add);
|
62
|
+
|
63
|
+
static VALUE r2tao_POA_create_thread_policy(VALUE self, VALUE value);
|
64
|
+
static VALUE r2tao_POA_create_lifespan_policy(VALUE self, VALUE value);
|
65
|
+
static VALUE r2tao_POA_create_id_uniqueness_policy(VALUE self, VALUE value);
|
66
|
+
static VALUE r2tao_POA_create_id_assignment_policy(VALUE self, VALUE value);
|
67
|
+
static VALUE r2tao_POA_create_implicit_activation_policy(VALUE self, VALUE value);
|
68
|
+
static VALUE r2tao_POA_create_servant_retention_policy(VALUE self, VALUE value);
|
69
|
+
static VALUE r2tao_POA_create_request_processing_policy(VALUE self, VALUE value);
|
70
|
+
|
71
|
+
static VALUE r2tao_ThreadPolicy_value(VALUE self);
|
72
|
+
static VALUE r2tao_LifespanPolicy_value(VALUE self);
|
73
|
+
static VALUE r2tao_IdAssignmentPolicy_value(VALUE self);
|
74
|
+
static VALUE r2tao_IdUniquenessPolicy_value(VALUE self);
|
75
|
+
static VALUE r2tao_ImplicitActivationPolicy_value(VALUE self);
|
76
|
+
static VALUE r2tao_ServantRetentionPolicy_value(VALUE self);
|
77
|
+
static VALUE r2tao_RequestProcessingPolicy_value(VALUE self);
|
78
|
+
static VALUE r2tao_BiDirPolicy_value(VALUE self);
|
79
|
+
static VALUE r2tao_RelativeRoundtripTimeoutPolicy_relative_expiry(VALUE self);
|
80
|
+
static VALUE r2tao_ConnectionTimeoutPolicy_relative_expiry(VALUE self);
|
81
|
+
|
82
|
+
#if defined(WIN32) && defined(_DEBUG)
|
83
|
+
extern "C" R2TAO_POL_EXPORT void Init_librpold()
|
84
|
+
#else
|
85
|
+
extern "C" R2TAO_POL_EXPORT void Init_librpol()
|
86
|
+
#endif
|
87
|
+
{
|
88
|
+
VALUE k;
|
89
|
+
|
90
|
+
if (r2tao_nsCORBA == 0)
|
91
|
+
{
|
92
|
+
rb_raise(rb_eRuntimeError, "CORBA base not initialized.");
|
93
|
+
return;
|
94
|
+
}
|
95
|
+
|
96
|
+
if (r2tao_nsPolicy) return;
|
97
|
+
|
98
|
+
validate_ID = rb_intern ("validate");
|
99
|
+
|
100
|
+
r2tao_x_InvalidPolicies = rb_const_get (r2tao_nsCORBA, rb_intern ("InvalidPolicies"));
|
101
|
+
r2tao_x_PolicyError = rb_const_get (r2tao_nsCORBA, rb_intern ("PolicyError"));
|
102
|
+
|
103
|
+
// overloaded method(s) with full Policy support
|
104
|
+
rb_define_method(r2tao_cORB, "create_policy", RUBY_METHOD_FUNC(rCORBA_ORB_create_policy), 2);
|
105
|
+
|
106
|
+
// basic Policy class
|
107
|
+
r2tao_nsPolicy = k = rb_eval_string ("R2CORBA::CORBA::Policy");
|
108
|
+
rb_define_method(k, "destroy", RUBY_METHOD_FUNC(r2tao_Policy_destroy), 0);
|
109
|
+
rb_define_method(k, "policy_type", RUBY_METHOD_FUNC(r2tao_Policy_type), 0);
|
110
|
+
rb_define_method(k, "copy", RUBY_METHOD_FUNC(r2tao_Policy_copy), 0);
|
111
|
+
|
112
|
+
// CORBA::Object policy support
|
113
|
+
k = r2tao_cObject;
|
114
|
+
rb_define_method(k, "_get_policy", RUBY_METHOD_FUNC(r2tao_Object_get_policy), 1);
|
115
|
+
rb_define_method(k, "_get_policy_overrides", RUBY_METHOD_FUNC(r2tao_Object_get_policy_overrides), 1);
|
116
|
+
rb_define_method(k, "_set_policy_overrides", RUBY_METHOD_FUNC(r2tao_Object_set_policy_overrides), 2);
|
117
|
+
rb_define_method(k, "_validate_connection", RUBY_METHOD_FUNC(r2tao_Object_validate_connection), 1);
|
118
|
+
|
119
|
+
// policy manager and current interfaces
|
120
|
+
r2tao_nsPolicyManager = k = rb_eval_string ("R2CORBA::CORBA::PolicyManager");
|
121
|
+
rb_define_method(k, "get_policy_overrides", RUBY_METHOD_FUNC(r2tao_PolicyManager_get_policy_overrides), 1);
|
122
|
+
rb_define_method(k, "set_policy_overrides", RUBY_METHOD_FUNC(r2tao_PolicyManager_set_policy_overrides), 2);
|
123
|
+
r2tao_nsPolicyCurrent = k = rb_eval_string ("R2CORBA::CORBA::PolicyCurrent");
|
124
|
+
|
125
|
+
// POA Policy support
|
126
|
+
k = r2tao_nsPOA;
|
127
|
+
rb_define_method(k, "create_thread_policy", RUBY_METHOD_FUNC(r2tao_POA_create_thread_policy), 1);
|
128
|
+
rb_define_method(k, "create_lifespan_policy", RUBY_METHOD_FUNC(r2tao_POA_create_lifespan_policy), 1);
|
129
|
+
rb_define_method(k, "create_id_assignment_policy", RUBY_METHOD_FUNC(r2tao_POA_create_id_assignment_policy), 1);
|
130
|
+
rb_define_method(k, "create_id_uniqueness_policy", RUBY_METHOD_FUNC(r2tao_POA_create_id_uniqueness_policy), 1);
|
131
|
+
rb_define_method(k, "create_implicit_activation_policy", RUBY_METHOD_FUNC(r2tao_POA_create_implicit_activation_policy), 1);
|
132
|
+
rb_define_method(k, "create_servant_retention_policy", RUBY_METHOD_FUNC(r2tao_POA_create_servant_retention_policy), 1);
|
133
|
+
rb_define_method(k, "create_request_processing_policy", RUBY_METHOD_FUNC(r2tao_POA_create_request_processing_policy), 1);
|
134
|
+
|
135
|
+
k = r2tao_nsThreadPolicy = rb_eval_string ("R2CORBA::PortableServer::ThreadPolicy");
|
136
|
+
rb_define_method(k, "value", RUBY_METHOD_FUNC(r2tao_ThreadPolicy_value), 0);
|
137
|
+
k = r2tao_nsLifespanPolicy = rb_eval_string ("R2CORBA::PortableServer::LifespanPolicy");
|
138
|
+
rb_define_method(k, "value", RUBY_METHOD_FUNC(r2tao_LifespanPolicy_value), 0);
|
139
|
+
k = r2tao_nsIdUniquenessPolicy = rb_eval_string ("R2CORBA::PortableServer::IdUniquenessPolicy");
|
140
|
+
rb_define_method(k, "value", RUBY_METHOD_FUNC(r2tao_IdUniquenessPolicy_value), 0);
|
141
|
+
k = r2tao_nsIdAssignmentPolicy = rb_eval_string ("R2CORBA::PortableServer::IdAssignmentPolicy");
|
142
|
+
rb_define_method(k, "value", RUBY_METHOD_FUNC(r2tao_IdAssignmentPolicy_value), 0);
|
143
|
+
k = r2tao_nsImplicitActivationPolicy = rb_eval_string ("R2CORBA::PortableServer::ImplicitActivationPolicy");
|
144
|
+
rb_define_method(k, "value", RUBY_METHOD_FUNC(r2tao_ImplicitActivationPolicy_value), 0);
|
145
|
+
k = r2tao_nsServantRetentionPolicy = rb_eval_string ("R2CORBA::PortableServer::ServantRetentionPolicy");
|
146
|
+
rb_define_method(k, "value", RUBY_METHOD_FUNC(r2tao_ServantRetentionPolicy_value), 0);
|
147
|
+
k = r2tao_nsRequestProcessingPolicy = rb_eval_string ("R2CORBA::PortableServer::RequestProcessingPolicy");
|
148
|
+
rb_define_method(k, "value", RUBY_METHOD_FUNC(r2tao_RequestProcessingPolicy_value), 0);
|
149
|
+
|
150
|
+
k = rb_eval_string ("R2CORBA::BiDirPolicy::BidirectionalPolicy");
|
151
|
+
rb_define_method(k, "value", RUBY_METHOD_FUNC(r2tao_BiDirPolicy_value), 0);
|
152
|
+
|
153
|
+
k = rb_eval_string ("R2CORBA::Messaging::RelativeRoundtripTimeoutPolicy");
|
154
|
+
rb_define_method(k, "relative_expiry", RUBY_METHOD_FUNC(r2tao_RelativeRoundtripTimeoutPolicy_relative_expiry), 0);
|
155
|
+
|
156
|
+
k = rb_eval_string ("R2CORBA::TAO::ConnectionTimeoutPolicy");
|
157
|
+
rb_define_method(k, "relative_expiry", RUBY_METHOD_FUNC(r2tao_ConnectionTimeoutPolicy_relative_expiry), 0);
|
158
|
+
}
|
159
|
+
|
160
|
+
//-------------------------------------------------------------------
|
161
|
+
// R2TAO ORB class
|
162
|
+
//
|
163
|
+
//===================================================================
|
164
|
+
|
165
|
+
static VALUE rCORBA_ORB_create_policy(VALUE self, VALUE identifier, VALUE any)
|
166
|
+
{
|
167
|
+
CORBA::ORB_ptr orb;
|
168
|
+
CORBA::Policy_var policy;
|
169
|
+
VALUE rpolicy = Qnil;
|
170
|
+
|
171
|
+
orb = r2tao_ORB_r2t (self);
|
172
|
+
|
173
|
+
R2TAO_TRY
|
174
|
+
{
|
175
|
+
try
|
176
|
+
{
|
177
|
+
CORBA::Any _xval;
|
178
|
+
r2tao_Ruby_to_Any(_xval, any);
|
179
|
+
policy = orb->create_policy(static_cast<CORBA::PolicyType> (NUM2LONG (identifier)), _xval);
|
180
|
+
CORBA::Object_ptr polobj = dynamic_cast<CORBA::Object_ptr> (policy.in ());
|
181
|
+
rpolicy = r2corba_Object_t2r (polobj);
|
182
|
+
rpolicy = FN_narrow.invoke (r2tao_nsPolicy, 1, &rpolicy);
|
183
|
+
}
|
184
|
+
catch (const CORBA::PolicyError& ex)
|
185
|
+
{
|
186
|
+
VALUE reason = INT2NUM (ex.reason);
|
187
|
+
rb_exc_raise (rb_class_new_instance (1, &reason, r2tao_x_PolicyError));
|
188
|
+
}
|
189
|
+
}
|
190
|
+
R2TAO_CATCH;
|
191
|
+
|
192
|
+
return rpolicy;
|
193
|
+
}
|
194
|
+
|
195
|
+
//-------------------------------------------------------------------
|
196
|
+
// R2TAO Policy class
|
197
|
+
//
|
198
|
+
//===================================================================
|
199
|
+
|
200
|
+
CORBA::Policy_ptr r2tao_Policy_r2t(VALUE obj)
|
201
|
+
{
|
202
|
+
CORBA::Object_ptr _obj = r2corba_Object_r2t (obj);
|
203
|
+
return dynamic_cast<CORBA::Policy_ptr> (_obj);
|
204
|
+
}
|
205
|
+
|
206
|
+
VALUE r2tao_Policy_t2r(CORBA::Policy_ptr policy)
|
207
|
+
{
|
208
|
+
VALUE robj = r2corba_Object_t2r (dynamic_cast<CORBA::Object_ptr> (policy));
|
209
|
+
return FN_narrow.invoke (r2tao_nsPolicy, 1, &robj);
|
210
|
+
}
|
211
|
+
|
212
|
+
VALUE r2tao_Policy_destroy(VALUE self)
|
213
|
+
{
|
214
|
+
R2TAO_TRY
|
215
|
+
{
|
216
|
+
CORBA::Policy_ptr _policy = r2tao_Policy_r2t (self);
|
217
|
+
_policy->destroy ();
|
218
|
+
}
|
219
|
+
R2TAO_CATCH;
|
220
|
+
return Qnil;
|
221
|
+
}
|
222
|
+
|
223
|
+
VALUE r2tao_Policy_type(VALUE self)
|
224
|
+
{
|
225
|
+
VALUE ret = Qnil;
|
226
|
+
|
227
|
+
R2TAO_TRY
|
228
|
+
{
|
229
|
+
CORBA::Policy_ptr _policy = r2tao_Policy_r2t (self);
|
230
|
+
CORBA::PolicyType _typ = _policy->policy_type ();
|
231
|
+
ret = LONG2NUM (static_cast<long> (_typ));
|
232
|
+
}
|
233
|
+
R2TAO_CATCH;
|
234
|
+
|
235
|
+
return ret;
|
236
|
+
}
|
237
|
+
|
238
|
+
VALUE r2tao_Policy_copy(VALUE self)
|
239
|
+
{
|
240
|
+
VALUE ret = Qnil;
|
241
|
+
|
242
|
+
R2TAO_TRY
|
243
|
+
{
|
244
|
+
CORBA::Policy_ptr _policy = r2tao_Policy_r2t (self);
|
245
|
+
CORBA::Policy_var _pol = _policy->copy ();
|
246
|
+
ret = r2tao_Policy_t2r (_pol.in ());
|
247
|
+
}
|
248
|
+
R2TAO_CATCH;
|
249
|
+
|
250
|
+
return ret;
|
251
|
+
}
|
252
|
+
|
253
|
+
//-------------------------------------------------------------------
|
254
|
+
// R2TAO CORBA::Object class
|
255
|
+
//
|
256
|
+
//===================================================================
|
257
|
+
|
258
|
+
VALUE r2tao_Object_get_policy(VALUE self, VALUE ptype)
|
259
|
+
{
|
260
|
+
CORBA::Object_ptr _obj = r2tao_Object_r2t(self);
|
261
|
+
|
262
|
+
VALUE rPolicyType_tc = rb_eval_string ("CORBA::PolicyType._tc");
|
263
|
+
rb_funcall (rPolicyType_tc, rb_intern ("validate"), 1, ptype);
|
264
|
+
|
265
|
+
R2TAO_TRY
|
266
|
+
{
|
267
|
+
CORBA::Policy_var policy =
|
268
|
+
_obj->_get_policy (static_cast<CORBA::PolicyType> (NUM2ULONG (ptype)));
|
269
|
+
VALUE rpol = r2tao_Policy_t2r (policy.in ());
|
270
|
+
return rpol;
|
271
|
+
}
|
272
|
+
R2TAO_CATCH;
|
273
|
+
|
274
|
+
return Qnil;
|
275
|
+
}
|
276
|
+
|
277
|
+
VALUE r2tao_Object_get_policy_overrides(VALUE self, VALUE ptseq)
|
278
|
+
{
|
279
|
+
CORBA::Object_ptr _obj = r2tao_Object_r2t(self);
|
280
|
+
|
281
|
+
VALUE rPolicyTypeSeq_tc = rb_eval_string ("CORBA::PolicyTypeSeq._tc");
|
282
|
+
rb_funcall (rPolicyTypeSeq_tc, rb_intern ("validate"), 1, ptseq);
|
283
|
+
|
284
|
+
R2TAO_TRY
|
285
|
+
{
|
286
|
+
CORBA::ULong alen = static_cast<unsigned long> (RARRAY_LEN (ptseq));
|
287
|
+
CORBA::PolicyTypeSeq _pts (alen);
|
288
|
+
_pts.length (alen);
|
289
|
+
for (CORBA::ULong l=0; l<alen ;++l)
|
290
|
+
_pts[l] = static_cast<CORBA::PolicyType> (NUM2ULONG (rb_ary_entry (ptseq, l)));
|
291
|
+
CORBA::PolicyList_var policies = _obj->_get_policy_overrides (_pts);
|
292
|
+
VALUE rpolicies = rb_ary_new2 (policies->length ());
|
293
|
+
for (CORBA::ULong l=0; l<policies->length () ;++l)
|
294
|
+
{
|
295
|
+
CORBA::Policy_ptr _policy = policies[l];
|
296
|
+
VALUE rpol = r2tao_Policy_t2r (_policy);
|
297
|
+
rb_ary_push (rpolicies, rpol);
|
298
|
+
}
|
299
|
+
return rpolicies;
|
300
|
+
}
|
301
|
+
R2TAO_CATCH;
|
302
|
+
|
303
|
+
return Qnil;
|
304
|
+
}
|
305
|
+
|
306
|
+
VALUE r2tao_Object_set_policy_overrides(VALUE self, VALUE policies, VALUE set_or_add)
|
307
|
+
{
|
308
|
+
CORBA::Object_ptr _obj = r2tao_Object_r2t(self);
|
309
|
+
|
310
|
+
VALUE rPolicyList_tc = rb_eval_string ("CORBA::PolicyList._tc");
|
311
|
+
rb_funcall (rPolicyList_tc, rb_intern ("validate"), 1, policies);
|
312
|
+
VALUE rSetOverrideType_tc = rb_eval_string ("CORBA::SetOverrideType._tc");
|
313
|
+
rb_funcall (rSetOverrideType_tc, rb_intern ("validate"), 1, set_or_add);
|
314
|
+
|
315
|
+
R2TAO_TRY
|
316
|
+
{
|
317
|
+
try
|
318
|
+
{
|
319
|
+
CORBA::ULong alen = static_cast<unsigned long> (RARRAY_LEN (policies));
|
320
|
+
CORBA::PolicyList pollist(alen);
|
321
|
+
pollist.length (alen);
|
322
|
+
for (CORBA::ULong l=0; l<alen ;++l)
|
323
|
+
{
|
324
|
+
VALUE pol = rb_ary_entry (policies, l);
|
325
|
+
pollist[l] = CORBA::Policy::_duplicate (r2tao_Policy_r2t (pol));
|
326
|
+
}
|
327
|
+
|
328
|
+
_obj = _obj->_set_policy_overrides (pollist, static_cast<CORBA::SetOverrideType> (NUM2LONG (set_or_add)));
|
329
|
+
return r2tao_Object_t2r (_obj);
|
330
|
+
}
|
331
|
+
catch (const CORBA::InvalidPolicies& ex)
|
332
|
+
{
|
333
|
+
VALUE rindices = rb_ary_new2 ((long)ex.indices.length ());
|
334
|
+
for (CORBA::ULong i=0; i<ex.indices.length () ;++i)
|
335
|
+
{
|
336
|
+
rb_ary_push (rindices, ULONG2NUM (ex.indices[i]));
|
337
|
+
}
|
338
|
+
rb_exc_raise (rb_class_new_instance (1, &rindices, r2tao_x_InvalidPolicies));
|
339
|
+
}
|
340
|
+
}
|
341
|
+
R2TAO_CATCH;
|
342
|
+
|
343
|
+
return Qnil;
|
344
|
+
}
|
345
|
+
|
346
|
+
VALUE r2tao_Object_validate_connection(VALUE self, VALUE inconsistent_pol_out)
|
347
|
+
{
|
348
|
+
CORBA::Object_ptr _obj = r2tao_Object_r2t(self);
|
349
|
+
|
350
|
+
r2tao_check_type (inconsistent_pol_out, rb_cArray);
|
351
|
+
|
352
|
+
R2TAO_TRY
|
353
|
+
{
|
354
|
+
CORBA::PolicyList_var pollist;
|
355
|
+
CORBA::Boolean val = _obj->_validate_connection (pollist.out ());
|
356
|
+
if (pollist.ptr () != 0)
|
357
|
+
{
|
358
|
+
for (CORBA::ULong l=0; l<pollist->length () ;++l)
|
359
|
+
{
|
360
|
+
CORBA::Policy_ptr _policy = pollist[l];
|
361
|
+
VALUE rpol = r2tao_Policy_t2r (_policy);
|
362
|
+
rb_ary_push (inconsistent_pol_out, rpol);
|
363
|
+
}
|
364
|
+
}
|
365
|
+
return val ? Qtrue : Qfalse;
|
366
|
+
}
|
367
|
+
R2TAO_CATCH;
|
368
|
+
|
369
|
+
return Qnil;
|
370
|
+
}
|
371
|
+
|
372
|
+
//-------------------------------------------------------------------
|
373
|
+
// R2TAO PolicyManager class
|
374
|
+
//
|
375
|
+
//===================================================================
|
376
|
+
|
377
|
+
static CORBA::PolicyManager_ptr r2tao_PolicyManager_r2t(VALUE obj)
|
378
|
+
{
|
379
|
+
CORBA::Object_ptr _obj = r2corba_Object_r2t (obj);
|
380
|
+
return dynamic_cast<CORBA::PolicyManager_ptr> (_obj);
|
381
|
+
}
|
382
|
+
|
383
|
+
static VALUE r2tao_PolicyManager_get_policy_overrides(VALUE self, VALUE ptseq)
|
384
|
+
{
|
385
|
+
CORBA::PolicyManager_ptr _polman = r2tao_PolicyManager_r2t(self);
|
386
|
+
|
387
|
+
VALUE rPolicyTypeSeq_tc = rb_eval_string ("CORBA::PolicyTypeSeq._tc");
|
388
|
+
rb_funcall (rPolicyTypeSeq_tc, rb_intern ("validate"), 1, ptseq);
|
389
|
+
|
390
|
+
R2TAO_TRY
|
391
|
+
{
|
392
|
+
CORBA::ULong alen = static_cast<unsigned long> (RARRAY_LEN (ptseq));
|
393
|
+
CORBA::PolicyTypeSeq _pts (alen);
|
394
|
+
_pts.length (alen);
|
395
|
+
for (CORBA::ULong l=0; l<alen ;++l)
|
396
|
+
_pts[l] = static_cast<CORBA::PolicyType> (NUM2ULONG (rb_ary_entry (ptseq, l)));
|
397
|
+
CORBA::PolicyList_var policies = _polman->get_policy_overrides (_pts);
|
398
|
+
VALUE rpolicies = rb_ary_new2 (policies->length ());
|
399
|
+
for (CORBA::ULong l=0; l<policies->length () ;++l)
|
400
|
+
{
|
401
|
+
CORBA::Policy_ptr _policy = policies[l];
|
402
|
+
VALUE rpol = r2tao_Policy_t2r (_policy);
|
403
|
+
rb_ary_push (rpolicies, rpol);
|
404
|
+
}
|
405
|
+
return rpolicies;
|
406
|
+
}
|
407
|
+
R2TAO_CATCH;
|
408
|
+
|
409
|
+
return Qnil;
|
410
|
+
}
|
411
|
+
|
412
|
+
static VALUE r2tao_PolicyManager_set_policy_overrides(VALUE self, VALUE policies, VALUE set_or_add)
|
413
|
+
{
|
414
|
+
CORBA::PolicyManager_ptr _polman = r2tao_PolicyManager_r2t(self);
|
415
|
+
|
416
|
+
VALUE rPolicyList_tc = rb_eval_string ("CORBA::PolicyList._tc");
|
417
|
+
rb_funcall (rPolicyList_tc, rb_intern ("validate"), 1, policies);
|
418
|
+
VALUE rSetOverrideType_tc = rb_eval_string ("CORBA::SetOverrideType._tc");
|
419
|
+
rb_funcall (rSetOverrideType_tc, rb_intern ("validate"), 1, set_or_add);
|
420
|
+
|
421
|
+
R2TAO_TRY
|
422
|
+
{
|
423
|
+
try
|
424
|
+
{
|
425
|
+
CORBA::ULong alen = static_cast<unsigned long> (RARRAY_LEN (policies));
|
426
|
+
CORBA::PolicyList pollist(alen);
|
427
|
+
pollist.length (alen);
|
428
|
+
for (CORBA::ULong l=0; l<alen ;++l)
|
429
|
+
{
|
430
|
+
VALUE pol = rb_ary_entry (policies, l);
|
431
|
+
pollist[l] = CORBA::Policy::_duplicate (r2tao_Policy_r2t (pol));
|
432
|
+
}
|
433
|
+
|
434
|
+
_polman->set_policy_overrides (
|
435
|
+
pollist,
|
436
|
+
static_cast<CORBA::SetOverrideType> (NUM2LONG (set_or_add)));
|
437
|
+
}
|
438
|
+
catch (const CORBA::InvalidPolicies& ex)
|
439
|
+
{
|
440
|
+
VALUE rindices = rb_ary_new2 ((long)ex.indices.length ());
|
441
|
+
for (CORBA::ULong i=0; i<ex.indices.length () ;++i)
|
442
|
+
{
|
443
|
+
rb_ary_push (rindices, ULONG2NUM (ex.indices[i]));
|
444
|
+
}
|
445
|
+
rb_exc_raise (rb_class_new_instance (1, &rindices, r2tao_x_InvalidPolicies));
|
446
|
+
}
|
447
|
+
}
|
448
|
+
R2TAO_CATCH;
|
449
|
+
|
450
|
+
return Qnil;
|
451
|
+
}
|
452
|
+
|
453
|
+
//-------------------------------------------------------------------
|
454
|
+
// R2TAO POA policy support
|
455
|
+
//
|
456
|
+
//===================================================================
|
457
|
+
|
458
|
+
VALUE r2tao_POA_create_thread_policy(VALUE self, VALUE value)
|
459
|
+
{
|
460
|
+
VALUE rpolicy = Qnil;
|
461
|
+
|
462
|
+
VALUE rpoltc = rb_eval_string("PortableServer::ThreadPolicyValue._tc");
|
463
|
+
rb_funcall (rpoltc, validate_ID, 1, value);
|
464
|
+
|
465
|
+
R2TAO_TRY
|
466
|
+
{
|
467
|
+
PortableServer::POA_var _poa = r2tao_POA_r2t (self);
|
468
|
+
PortableServer::LifespanPolicyValue pval =
|
469
|
+
static_cast<PortableServer::LifespanPolicyValue> (NUM2LONG (value));
|
470
|
+
PortableServer::LifespanPolicy_var policy = _poa->create_lifespan_policy (pval);
|
471
|
+
rpolicy = r2tao_Policy_t2r (policy.in ());
|
472
|
+
}
|
473
|
+
R2TAO_CATCH;
|
474
|
+
|
475
|
+
return rpolicy;
|
476
|
+
}
|
477
|
+
|
478
|
+
VALUE r2tao_POA_create_lifespan_policy(VALUE self, VALUE value)
|
479
|
+
{
|
480
|
+
VALUE rpolicy = Qnil;
|
481
|
+
|
482
|
+
VALUE rpoltc = rb_eval_string("PortableServer::LifespanPolicyValue._tc");
|
483
|
+
rb_funcall (rpoltc, validate_ID, 1, value);
|
484
|
+
|
485
|
+
R2TAO_TRY
|
486
|
+
{
|
487
|
+
PortableServer::POA_var _poa = r2tao_POA_r2t (self);
|
488
|
+
PortableServer::LifespanPolicyValue pval =
|
489
|
+
static_cast<PortableServer::LifespanPolicyValue> (NUM2LONG (value));
|
490
|
+
PortableServer::LifespanPolicy_var policy = _poa->create_lifespan_policy (pval);
|
491
|
+
rpolicy = r2tao_Policy_t2r (policy.in ());
|
492
|
+
}
|
493
|
+
R2TAO_CATCH;
|
494
|
+
|
495
|
+
return rpolicy;
|
496
|
+
}
|
497
|
+
|
498
|
+
VALUE r2tao_POA_create_id_uniqueness_policy(VALUE self, VALUE value)
|
499
|
+
{
|
500
|
+
VALUE rpolicy = Qnil;
|
501
|
+
|
502
|
+
VALUE rpoltc = rb_eval_string("PortableServer::IdUniquenessPolicyValue._tc");
|
503
|
+
rb_funcall (rpoltc, validate_ID, 1, value);
|
504
|
+
|
505
|
+
R2TAO_TRY
|
506
|
+
{
|
507
|
+
PortableServer::POA_var _poa = r2tao_POA_r2t (self);
|
508
|
+
PortableServer::IdUniquenessPolicyValue pval =
|
509
|
+
static_cast<PortableServer::IdUniquenessPolicyValue> (NUM2LONG (value));
|
510
|
+
PortableServer::IdUniquenessPolicy_var policy = _poa->create_id_uniqueness_policy (pval);
|
511
|
+
rpolicy = r2tao_Policy_t2r (policy.in ());
|
512
|
+
}
|
513
|
+
R2TAO_CATCH;
|
514
|
+
|
515
|
+
return rpolicy;
|
516
|
+
}
|
517
|
+
|
518
|
+
VALUE r2tao_POA_create_id_assignment_policy(VALUE self, VALUE value)
|
519
|
+
{
|
520
|
+
VALUE rpolicy = Qnil;
|
521
|
+
|
522
|
+
VALUE rpoltc = rb_eval_string("PortableServer::IdAssignmentPolicyValue._tc");
|
523
|
+
rb_funcall (rpoltc, validate_ID, 1, value);
|
524
|
+
|
525
|
+
R2TAO_TRY
|
526
|
+
{
|
527
|
+
PortableServer::POA_var _poa = r2tao_POA_r2t (self);
|
528
|
+
PortableServer::IdAssignmentPolicyValue pval =
|
529
|
+
static_cast<PortableServer::IdAssignmentPolicyValue> (NUM2LONG (value));
|
530
|
+
PortableServer::IdAssignmentPolicy_var policy = _poa->create_id_assignment_policy (pval);
|
531
|
+
rpolicy = r2tao_Policy_t2r (policy.in ());
|
532
|
+
}
|
533
|
+
R2TAO_CATCH;
|
534
|
+
|
535
|
+
return rpolicy;
|
536
|
+
}
|
537
|
+
|
538
|
+
VALUE r2tao_POA_create_implicit_activation_policy(VALUE self, VALUE value)
|
539
|
+
{
|
540
|
+
VALUE rpolicy = Qnil;
|
541
|
+
|
542
|
+
VALUE rpoltc = rb_eval_string("PortableServer::ImplicitActivationPolicyValue._tc");
|
543
|
+
rb_funcall (rpoltc, validate_ID, 1, value);
|
544
|
+
|
545
|
+
R2TAO_TRY
|
546
|
+
{
|
547
|
+
PortableServer::POA_var _poa = r2tao_POA_r2t (self);
|
548
|
+
PortableServer::ImplicitActivationPolicyValue pval =
|
549
|
+
static_cast<PortableServer::ImplicitActivationPolicyValue> (NUM2LONG (value));
|
550
|
+
PortableServer::ImplicitActivationPolicy_var policy = _poa->create_implicit_activation_policy (pval);
|
551
|
+
rpolicy = r2tao_Policy_t2r (policy.in ());
|
552
|
+
}
|
553
|
+
R2TAO_CATCH;
|
554
|
+
|
555
|
+
return rpolicy;
|
556
|
+
}
|
557
|
+
|
558
|
+
VALUE r2tao_POA_create_servant_retention_policy(VALUE self, VALUE value)
|
559
|
+
{
|
560
|
+
VALUE rpolicy = Qnil;
|
561
|
+
|
562
|
+
VALUE rpoltc = rb_eval_string("PortableServer::ServantRetentionPolicyValue._tc");
|
563
|
+
rb_funcall (rpoltc, validate_ID, 1, value);
|
564
|
+
|
565
|
+
R2TAO_TRY
|
566
|
+
{
|
567
|
+
PortableServer::POA_var _poa = r2tao_POA_r2t (self);
|
568
|
+
PortableServer::ServantRetentionPolicyValue pval =
|
569
|
+
static_cast<PortableServer::ServantRetentionPolicyValue> (NUM2LONG (value));
|
570
|
+
PortableServer::ServantRetentionPolicy_var policy = _poa->create_servant_retention_policy (pval);
|
571
|
+
rpolicy = r2tao_Policy_t2r (policy.in ());
|
572
|
+
}
|
573
|
+
R2TAO_CATCH;
|
574
|
+
|
575
|
+
return rpolicy;
|
576
|
+
}
|
577
|
+
|
578
|
+
VALUE r2tao_POA_create_request_processing_policy(VALUE self, VALUE value)
|
579
|
+
{
|
580
|
+
VALUE rpolicy = Qnil;
|
581
|
+
|
582
|
+
VALUE rpoltc = rb_eval_string("PortableServer::RequestProcessingPolicyValue._tc");
|
583
|
+
rb_funcall (rpoltc, validate_ID, 1, value);
|
584
|
+
|
585
|
+
R2TAO_TRY
|
586
|
+
{
|
587
|
+
PortableServer::POA_var _poa = r2tao_POA_r2t (self);
|
588
|
+
PortableServer::RequestProcessingPolicyValue pval =
|
589
|
+
static_cast<PortableServer::RequestProcessingPolicyValue> (NUM2LONG (value));
|
590
|
+
PortableServer::RequestProcessingPolicy_var policy = _poa->create_request_processing_policy (pval);
|
591
|
+
rpolicy = r2tao_Policy_t2r (policy.in ());
|
592
|
+
}
|
593
|
+
R2TAO_CATCH;
|
594
|
+
|
595
|
+
return rpolicy;
|
596
|
+
}
|
597
|
+
|
598
|
+
//-------------------------------------------------------------------
|
599
|
+
// R2TAO specific policy classes
|
600
|
+
//
|
601
|
+
//===================================================================
|
602
|
+
|
603
|
+
VALUE r2tao_ThreadPolicy_value(VALUE self)
|
604
|
+
{
|
605
|
+
VALUE ret = Qnil;
|
606
|
+
|
607
|
+
R2TAO_TRY
|
608
|
+
{
|
609
|
+
PortableServer::ThreadPolicy_ptr _policy =
|
610
|
+
dynamic_cast<PortableServer::ThreadPolicy_ptr> (r2tao_Policy_r2t (self));
|
611
|
+
PortableServer::ThreadPolicyValue _val = _policy->value ();
|
612
|
+
ret = LONG2NUM (static_cast<long> (_val));
|
613
|
+
}
|
614
|
+
R2TAO_CATCH;
|
615
|
+
|
616
|
+
return ret;
|
617
|
+
}
|
618
|
+
|
619
|
+
VALUE r2tao_LifespanPolicy_value(VALUE self)
|
620
|
+
{
|
621
|
+
VALUE ret = Qnil;
|
622
|
+
|
623
|
+
R2TAO_TRY
|
624
|
+
{
|
625
|
+
PortableServer::LifespanPolicy_ptr _policy =
|
626
|
+
dynamic_cast<PortableServer::LifespanPolicy_ptr> (r2tao_Policy_r2t (self));
|
627
|
+
PortableServer::LifespanPolicyValue _val = _policy->value ();
|
628
|
+
ret = LONG2NUM (static_cast<long> (_val));
|
629
|
+
}
|
630
|
+
R2TAO_CATCH;
|
631
|
+
|
632
|
+
return ret;
|
633
|
+
}
|
634
|
+
|
635
|
+
VALUE r2tao_IdAssignmentPolicy_value(VALUE self)
|
636
|
+
{
|
637
|
+
VALUE ret = Qnil;
|
638
|
+
|
639
|
+
R2TAO_TRY
|
640
|
+
{
|
641
|
+
PortableServer::IdAssignmentPolicy_ptr _policy =
|
642
|
+
dynamic_cast<PortableServer::IdAssignmentPolicy_ptr> (r2tao_Policy_r2t (self));
|
643
|
+
PortableServer::IdAssignmentPolicyValue _val = _policy->value ();
|
644
|
+
ret = LONG2NUM (static_cast<long> (_val));
|
645
|
+
}
|
646
|
+
R2TAO_CATCH;
|
647
|
+
|
648
|
+
return ret;
|
649
|
+
}
|
650
|
+
|
651
|
+
VALUE r2tao_IdUniquenessPolicy_value(VALUE self)
|
652
|
+
{
|
653
|
+
VALUE ret = Qnil;
|
654
|
+
|
655
|
+
R2TAO_TRY
|
656
|
+
{
|
657
|
+
PortableServer::IdUniquenessPolicy_ptr _policy =
|
658
|
+
dynamic_cast<PortableServer::IdUniquenessPolicy_ptr> (r2tao_Policy_r2t (self));
|
659
|
+
PortableServer::IdUniquenessPolicyValue _val = _policy->value ();
|
660
|
+
ret = LONG2NUM (static_cast<long> (_val));
|
661
|
+
}
|
662
|
+
R2TAO_CATCH;
|
663
|
+
|
664
|
+
return ret;
|
665
|
+
}
|
666
|
+
|
667
|
+
VALUE r2tao_ImplicitActivationPolicy_value(VALUE self)
|
668
|
+
{
|
669
|
+
VALUE ret = Qnil;
|
670
|
+
|
671
|
+
R2TAO_TRY
|
672
|
+
{
|
673
|
+
PortableServer::ImplicitActivationPolicy_ptr _policy =
|
674
|
+
dynamic_cast<PortableServer::ImplicitActivationPolicy_ptr> (r2tao_Policy_r2t (self));
|
675
|
+
PortableServer::ImplicitActivationPolicyValue _val = _policy->value ();
|
676
|
+
ret = LONG2NUM (static_cast<long> (_val));
|
677
|
+
}
|
678
|
+
R2TAO_CATCH;
|
679
|
+
|
680
|
+
return ret;
|
681
|
+
}
|
682
|
+
|
683
|
+
VALUE r2tao_ServantRetentionPolicy_value(VALUE self)
|
684
|
+
{
|
685
|
+
VALUE ret = Qnil;
|
686
|
+
|
687
|
+
R2TAO_TRY
|
688
|
+
{
|
689
|
+
PortableServer::ServantRetentionPolicy_ptr _policy =
|
690
|
+
dynamic_cast<PortableServer::ServantRetentionPolicy_ptr> (r2tao_Policy_r2t (self));
|
691
|
+
PortableServer::ServantRetentionPolicyValue _val = _policy->value ();
|
692
|
+
ret = LONG2NUM (static_cast<long> (_val));
|
693
|
+
}
|
694
|
+
R2TAO_CATCH;
|
695
|
+
|
696
|
+
return ret;
|
697
|
+
}
|
698
|
+
|
699
|
+
VALUE r2tao_RequestProcessingPolicy_value(VALUE self)
|
700
|
+
{
|
701
|
+
VALUE ret = Qnil;
|
702
|
+
|
703
|
+
R2TAO_TRY
|
704
|
+
{
|
705
|
+
PortableServer::RequestProcessingPolicy_ptr _policy =
|
706
|
+
dynamic_cast<PortableServer::RequestProcessingPolicy_ptr> (r2tao_Policy_r2t (self));
|
707
|
+
PortableServer::RequestProcessingPolicyValue _val = _policy->value ();
|
708
|
+
ret = LONG2NUM (static_cast<long> (_val));
|
709
|
+
}
|
710
|
+
R2TAO_CATCH;
|
711
|
+
|
712
|
+
return ret;
|
713
|
+
}
|
714
|
+
|
715
|
+
VALUE r2tao_BiDirPolicy_value(VALUE self)
|
716
|
+
{
|
717
|
+
VALUE ret = Qnil;
|
718
|
+
|
719
|
+
R2TAO_TRY
|
720
|
+
{
|
721
|
+
BiDirPolicy::BidirectionalPolicy_ptr _policy =
|
722
|
+
dynamic_cast<BiDirPolicy::BidirectionalPolicy_ptr> (r2tao_Policy_r2t (self));
|
723
|
+
BiDirPolicy::BidirectionalPolicyValue _val = _policy->value ();
|
724
|
+
ret = LONG2NUM (static_cast<long> (_val));
|
725
|
+
}
|
726
|
+
R2TAO_CATCH;
|
727
|
+
|
728
|
+
return ret;
|
729
|
+
}
|
730
|
+
|
731
|
+
VALUE r2tao_RelativeRoundtripTimeoutPolicy_relative_expiry(VALUE self)
|
732
|
+
{
|
733
|
+
VALUE ret = Qnil;
|
734
|
+
|
735
|
+
R2TAO_TRY
|
736
|
+
{
|
737
|
+
Messaging::RelativeRoundtripTimeoutPolicy_ptr _policy =
|
738
|
+
dynamic_cast<Messaging::RelativeRoundtripTimeoutPolicy_ptr> (r2tao_Policy_r2t (self));
|
739
|
+
TimeBase::TimeT _val = _policy->relative_expiry ();
|
740
|
+
ret = ULL2NUM (_val);
|
741
|
+
}
|
742
|
+
R2TAO_CATCH;
|
743
|
+
|
744
|
+
return ret;
|
745
|
+
}
|
746
|
+
|
747
|
+
VALUE r2tao_ConnectionTimeoutPolicy_relative_expiry(VALUE self)
|
748
|
+
{
|
749
|
+
VALUE ret = Qnil;
|
750
|
+
|
751
|
+
R2TAO_TRY
|
752
|
+
{
|
753
|
+
TAO::ConnectionTimeoutPolicy_ptr _policy =
|
754
|
+
dynamic_cast<TAO::ConnectionTimeoutPolicy_ptr> (r2tao_Policy_r2t (self));
|
755
|
+
TimeBase::TimeT _val = _policy->relative_expiry ();
|
756
|
+
ret = ULL2NUM (_val);
|
757
|
+
}
|
758
|
+
R2TAO_CATCH;
|
759
|
+
|
760
|
+
return ret;
|
761
|
+
}
|
762
|
+
|
763
|
+
// end of orb.cpp
|