r2corba 1.4.1 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (243) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES +15 -1
  3. data/LICENSE +5 -5
  4. data/README.rdoc +62 -0
  5. data/THANKS +7 -5
  6. data/bin/r2corba +1 -1
  7. data/bin/ridlc +1 -1
  8. data/bin/rins +1 -1
  9. data/ext/extload/extload.c +5 -6
  10. data/ext/libr2tao/any.cpp +1 -2
  11. data/ext/libr2tao/exception.cpp +0 -1
  12. data/ext/libr2tao/exception.h +0 -2
  13. data/ext/libr2tao/longdouble.cpp +0 -1
  14. data/ext/libr2tao/longdouble.h +0 -1
  15. data/ext/libr2tao/object.cpp +4 -4
  16. data/ext/libr2tao/object.h +0 -1
  17. data/ext/libr2tao/orb.cpp +8 -9
  18. data/ext/libr2tao/orb.h +0 -1
  19. data/ext/libr2tao/r2tao_export.h +1 -2
  20. data/ext/libr2tao/r2tao_ext.h +0 -13
  21. data/ext/libr2tao/required.cpp +3 -22
  22. data/ext/libr2tao/required.h +14 -51
  23. data/ext/libr2tao/typecode.cpp +0 -1
  24. data/ext/libr2tao/typecode.h +0 -1
  25. data/ext/libr2tao/values.cpp +13 -14
  26. data/ext/libr2tao/values.h +20 -23
  27. data/ext/librpoa/iortable.cpp +3 -3
  28. data/ext/librpoa/poa.cpp +7 -7
  29. data/ext/librpoa/poa.h +0 -1
  30. data/ext/librpoa/rpoa_export.h +0 -1
  31. data/ext/librpoa/servant.cpp +17 -92
  32. data/ext/librpoa/servant.h +13 -36
  33. data/ext/librpol/policies.cpp +0 -1
  34. data/ext/librpol/policies.h +0 -1
  35. data/ext/librpol/rpol_export.h +0 -1
  36. data/lib/corba.rb +0 -1
  37. data/lib/corba/cbase/IORMap.rb +0 -1
  38. data/lib/corba/cbase/ORB.rb +15 -10
  39. data/lib/corba/cbase/Request.rb +1 -2
  40. data/lib/corba/cbase/Streams.rb +2 -3
  41. data/lib/corba/cbase/Stub.rb +0 -1
  42. data/lib/corba/cbase/Typecode.rb +6 -7
  43. data/lib/corba/cbase/Values.rb +0 -1
  44. data/lib/corba/cbase/exception.rb +2 -3
  45. data/lib/corba/cbase/poa.rb +0 -1
  46. data/lib/corba/cbase/policies.rb +2 -3
  47. data/lib/corba/cbase/post_require.rb +1 -2
  48. data/lib/corba/cbase/require.rb +2 -1
  49. data/lib/corba/cmds/base.rb +1 -2
  50. data/lib/corba/cmds/test.rb +0 -1
  51. data/lib/corba/common/Any.rb +1 -2
  52. data/lib/corba/common/IDL.rb +5 -9
  53. data/lib/corba/common/ORB.rb +2 -3
  54. data/lib/corba/common/Object.rb +5 -3
  55. data/lib/corba/common/Request.rb +1 -2
  56. data/lib/corba/common/Servant.rb +0 -1
  57. data/lib/corba/common/Struct.rb +1 -2
  58. data/lib/corba/common/Stub.rb +1 -2
  59. data/lib/corba/common/Typecode.rb +56 -57
  60. data/lib/corba/common/Union.rb +1 -2
  61. data/lib/corba/common/Values.rb +1 -2
  62. data/lib/corba/common/const.rb +2 -3
  63. data/lib/corba/common/exception.rb +0 -1
  64. data/lib/corba/common/require.rb +8 -1
  65. data/lib/corba/common/version.rb +3 -4
  66. data/lib/corba/idl/IDL.rb +0 -1
  67. data/lib/corba/idl/IORTable.pidl +0 -1
  68. data/lib/corba/idl/TAO_Ext.pidl +0 -1
  69. data/lib/corba/idl/require.rb +0 -1
  70. data/lib/corba/jbase/Any.rb +24 -25
  71. data/lib/corba/jbase/IORMap.rb +1 -2
  72. data/lib/corba/jbase/ORB.rb +17 -5
  73. data/lib/corba/jbase/Object.rb +12 -12
  74. data/lib/corba/jbase/Request.rb +6 -7
  75. data/lib/corba/jbase/Servant.rb +14 -14
  76. data/lib/corba/jbase/ServerRequest.rb +8 -9
  77. data/lib/corba/jbase/Streams.rb +4 -5
  78. data/lib/corba/jbase/Stub.rb +0 -1
  79. data/lib/corba/jbase/Typecode.rb +14 -15
  80. data/lib/corba/jbase/Values.rb +0 -1
  81. data/lib/corba/jbase/exception.rb +1 -2
  82. data/lib/corba/jbase/poa.rb +3 -4
  83. data/lib/corba/jbase/policies.rb +4 -5
  84. data/lib/corba/jbase/post_require.rb +0 -1
  85. data/lib/corba/jbase/require.rb +7 -5
  86. data/lib/corba/naming.rb +0 -1
  87. data/lib/corba/naming_service.rb +0 -1
  88. data/lib/corba/poa.rb +1 -2
  89. data/lib/corba/policies.rb +1 -2
  90. data/lib/corba/require.rb +2 -3
  91. data/lib/corba/svcs/ins/cos_naming.rb +64 -67
  92. data/lib/corba/svcs/ins/ins.rb +24 -25
  93. data/lib/corba/svcs/ins/naming_service.rb +3 -4
  94. data/lib/ridlbe/ruby/config.rb +55 -58
  95. data/lib/ridlbe/ruby/require.rb +0 -1
  96. data/lib/ridlbe/ruby/walker.rb +38 -38
  97. data/mkrf_conf_srcgem.rb +16 -12
  98. data/rakelib/bin.rake +2 -3
  99. data/rakelib/bin.rb +4 -5
  100. data/rakelib/build.rake +21 -21
  101. data/rakelib/config.rake +1 -2
  102. data/rakelib/config.rb +114 -22
  103. data/rakelib/ext.rake +16 -16
  104. data/rakelib/ext.rb +18 -49
  105. data/rakelib/ext_r2tao.rb +38 -25
  106. data/rakelib/gem.rake +86 -47
  107. data/rakelib/gem.rb +14 -15
  108. data/rakelib/package.rake +1 -2
  109. data/rakelib/test.rake +0 -1
  110. data/test/BiDirectional/Test.idl +0 -1
  111. data/test/BiDirectional/client.rb +4 -5
  112. data/test/BiDirectional/run_test.rb +1 -2
  113. data/test/BiDirectional/server.rb +4 -6
  114. data/test/CORBA_Services/Naming/BindingIterator/Test.idl +0 -1
  115. data/test/CORBA_Services/Naming/BindingIterator/client.rb +5 -6
  116. data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +1 -2
  117. data/test/CORBA_Services/Naming/BindingIterator/server.rb +4 -5
  118. data/test/CORBA_Services/Naming/Corbaname/Test.idl +0 -1
  119. data/test/CORBA_Services/Naming/Corbaname/client.rb +3 -4
  120. data/test/CORBA_Services/Naming/Corbaname/run_test.rb +1 -2
  121. data/test/CORBA_Services/Naming/Corbaname/server.rb +10 -11
  122. data/test/CORBA_Services/Naming/Simple/Test.idl +0 -1
  123. data/test/CORBA_Services/Naming/Simple/client.rb +4 -5
  124. data/test/CORBA_Services/Naming/Simple/run_test.rb +1 -2
  125. data/test/CORBA_Services/Naming/Simple/server.rb +4 -5
  126. data/test/Collocation/Diamond.idl +0 -1
  127. data/test/Collocation/run_test.rb +0 -1
  128. data/test/Collocation/test.rb +2 -3
  129. data/test/Connect_Timeout/Test.idl +0 -1
  130. data/test/Connect_Timeout/client.rb +3 -5
  131. data/test/Connect_Timeout/run_test.rb +0 -1
  132. data/test/DII/Test.idl +0 -1
  133. data/test/DII/client.rb +5 -6
  134. data/test/DII/run_test.rb +1 -2
  135. data/test/DII/server.rb +3 -4
  136. data/test/DSI/Test.idl +0 -1
  137. data/test/DSI/client.rb +3 -4
  138. data/test/DSI/run_test.rb +1 -2
  139. data/test/DSI/server.rb +3 -4
  140. data/test/Exceptions/Test.idl +0 -1
  141. data/test/Exceptions/client.rb +5 -6
  142. data/test/Exceptions/run_test.rb +1 -2
  143. data/test/Exceptions/server.rb +3 -4
  144. data/test/Hello/Test.idl +0 -1
  145. data/test/Hello/client.rb +3 -4
  146. data/test/Hello/run_test.rb +1 -2
  147. data/test/Hello/server.rb +3 -4
  148. data/test/IDL_Test/Test.idl +4 -1
  149. data/test/IDL_Test/client.rb +6 -5
  150. data/test/IDL_Test/run_test.rb +1 -2
  151. data/test/IDL_Test/server.rb +8 -4
  152. data/test/IORMap/Test.idl +0 -1
  153. data/test/IORMap/client.rb +3 -4
  154. data/test/IORMap/run_test.rb +1 -2
  155. data/test/IORMap/server.rb +4 -5
  156. data/test/IORTable/Test.idl +0 -1
  157. data/test/IORTable/client.rb +3 -4
  158. data/test/IORTable/run_test.rb +1 -2
  159. data/test/IORTable/server.rb +4 -5
  160. data/test/Implicit_Conversion/Test.idl +0 -1
  161. data/test/Implicit_Conversion/client.rb +4 -5
  162. data/test/Implicit_Conversion/run_test.rb +1 -2
  163. data/test/Implicit_Conversion/server.rb +3 -4
  164. data/test/Multi_Threading/Multiple_ORB/Test.idl +0 -1
  165. data/test/Multi_Threading/Multiple_ORB/client.rb +3 -4
  166. data/test/Multi_Threading/Multiple_ORB/run_test.rb +2 -3
  167. data/test/Multi_Threading/Multiple_ORB/server.rb +3 -4
  168. data/test/Multi_Threading/Simple/Test.idl +1 -2
  169. data/test/Multi_Threading/Simple/client.rb +18 -14
  170. data/test/Multi_Threading/Simple/run_test.rb +1 -2
  171. data/test/Multi_Threading/Simple/server.rb +6 -7
  172. data/test/Multi_Threading/Threads/Test.idl +0 -4
  173. data/test/Multi_Threading/Threads/client.rb +10 -13
  174. data/test/Multi_Threading/Threads/run_test.rb +1 -2
  175. data/test/Multi_Threading/Threads/server.rb +5 -8
  176. data/test/Multi_Threading/Threads/watchdog.rb +3 -3
  177. data/test/Multiple_Servant_Interfaces/Test.idl +0 -1
  178. data/test/Multiple_Servant_Interfaces/client.rb +3 -4
  179. data/test/Multiple_Servant_Interfaces/run_test.rb +1 -2
  180. data/test/Multiple_Servant_Interfaces/server.rb +3 -4
  181. data/test/Nil/Test.idl +0 -1
  182. data/test/Nil/run_test.rb +0 -1
  183. data/test/Nil/test.rb +11 -9
  184. data/test/OBV/AbstractInterface/client.rb +3 -4
  185. data/test/OBV/AbstractInterface/run_test.rb +1 -2
  186. data/test/OBV/AbstractInterface/server.rb +3 -4
  187. data/test/OBV/AbstractInterface/test.idl +0 -1
  188. data/test/OBV/Custom/OBV_impl.rb +0 -1
  189. data/test/OBV/Custom/client.rb +3 -4
  190. data/test/OBV/Custom/run_test.rb +1 -2
  191. data/test/OBV/Custom/server.rb +3 -4
  192. data/test/OBV/Simple/OBV_impl.rb +0 -1
  193. data/test/OBV/Simple/client.rb +3 -4
  194. data/test/OBV/Simple/run_test.rb +1 -2
  195. data/test/OBV/Simple/server.rb +3 -4
  196. data/test/OBV/Simple_Event/Event_impl.rb +0 -1
  197. data/test/OBV/Simple_Event/client.rb +3 -4
  198. data/test/OBV/Simple_Event/run_test.rb +1 -2
  199. data/test/OBV/Simple_Event/server.rb +3 -4
  200. data/test/OBV/Supports/client.rb +3 -4
  201. data/test/OBV/Supports/run_test.rb +1 -2
  202. data/test/OBV/Supports/server.rb +3 -4
  203. data/test/OBV/Supports/supports.idl +0 -1
  204. data/test/OBV/Supports/supports_impl.rb +0 -1
  205. data/test/OBV/Tree/client.rb +3 -4
  206. data/test/OBV/Tree/run_test.rb +1 -2
  207. data/test/OBV/Tree/server.rb +3 -4
  208. data/test/OBV/Tree/test.idl +0 -1
  209. data/test/OBV/Truncatable/Extra.idl +0 -1
  210. data/test/OBV/Truncatable/Truncatable_impl.rb +1 -2
  211. data/test/OBV/Truncatable/client.rb +4 -5
  212. data/test/OBV/Truncatable/run_test.rb +1 -2
  213. data/test/OBV/Truncatable/server.rb +3 -4
  214. data/test/OBV/ValueBox/client.rb +44 -45
  215. data/test/OBV/ValueBox/run_test.rb +1 -2
  216. data/test/OBV/ValueBox/server.rb +29 -29
  217. data/test/Object/Test.idl +0 -1
  218. data/test/Object/client.rb +33 -25
  219. data/test/Object/run_test.rb +1 -2
  220. data/test/Object/server.rb +3 -4
  221. data/test/POA/run_test.rb +0 -1
  222. data/test/POA/test.rb +4 -5
  223. data/test/Param_Test/client.rb +8 -9
  224. data/test/Param_Test/run_test.rb +1 -2
  225. data/test/Param_Test/server.rb +7 -8
  226. data/test/Performance/Simple/Test.idl +0 -1
  227. data/test/Performance/Simple/client.rb +3 -4
  228. data/test/Performance/Simple/run_test.rb +1 -2
  229. data/test/Performance/Simple/server.rb +3 -4
  230. data/test/Policies/Test.idl +0 -1
  231. data/test/Policies/run_test.rb +0 -1
  232. data/test/Policies/test.rb +2 -4
  233. data/test/Timeout/client.rb +6 -7
  234. data/test/Timeout/run_test.rb +1 -2
  235. data/test/Timeout/server.rb +4 -5
  236. data/test/Timeout/test.idl +0 -1
  237. data/test/lib/assert.rb +0 -2
  238. data/test/lib/test.rb +15 -17
  239. data/test/test_runner.rb +6 -8
  240. metadata +221 -222
  241. data/README +0 -62
  242. data/ext/librpoa/srvreq_fix.cpp +0 -283
  243. data/ext/librpoa/srvreq_fix.h +0 -149
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  module R2CORBA
@@ -53,12 +52,12 @@ module R2CORBA
53
52
  end
54
53
 
55
54
  def describe(opsig)
56
- raise CORBA::BAD_INV_ORDER.new('',0,CORBA::COMPLETED_NO) if @nvlist_
57
- raise CORBA::NO_IMPLEMENT.new('',0,CORBA::COMPLETED_NO) unless opsig && (Hash === opsig)
55
+ raise CORBA::BAD_INV_ORDER.new('', 0, CORBA::COMPLETED_NO) if @nvlist_
56
+ raise CORBA::NO_IMPLEMENT.new('', 0, CORBA::COMPLETED_NO) unless opsig && (Hash === opsig)
58
57
  @arg_list_ = opsig[:arg_list]
59
58
  @result_type_ = opsig[:result_type]
60
59
  @exc_list_ = opsig[:exc_list]
61
- raise CORBA::BAD_PARAM.new('',0,CORBA::COMPLETED_NO) unless (@arg_list_.nil? || @arg_list_.is_a?(Array)) &&
60
+ raise CORBA::BAD_PARAM.new('', 0, CORBA::COMPLETED_NO) unless (@arg_list_.nil? || @arg_list_.is_a?(Array)) &&
62
61
  (@result_type_.nil? || @result_type_.is_a?(CORBA::TypeCode)) &&
63
62
  (@exc_list_.nil? || @exc_list_.is_a?(Array))
64
63
  @nvlist_ = extract_arguments_(@arg_list_)
@@ -66,7 +65,7 @@ module R2CORBA
66
65
  end
67
66
 
68
67
  def arguments
69
- raise CORBA::BAD_INV_ORDER.new('',0,CORBA::COMPLETED_NO) unless @nvlist_
68
+ raise CORBA::BAD_INV_ORDER.new('', 0, CORBA::COMPLETED_NO) unless @nvlist_
70
69
  unless @arg_
71
70
  @arg_ = []
72
71
  @nvlist_.count().times do |i|
@@ -82,7 +81,7 @@ module R2CORBA
82
81
  self.arguments # make sure the @arg_ member has been initialized
83
82
  key = arg_index_from_name(key) if String === key
84
83
  key = key.to_i if key
85
- raise CORBA::BAD_PARAM.new('', 0, CORBA::COMPLETD_NO) unless key && (key>=0) && (key<@arg_.size)
84
+ raise CORBA::BAD_PARAM.new('', 0, CORBA::COMPLETD_NO) unless key && (key >= 0) && (key < @arg_.size)
86
85
  @arg_[key]
87
86
  end
88
87
 
@@ -90,7 +89,7 @@ module R2CORBA
90
89
  self.arguments # make sure the @arg_ member has been initialized
91
90
  key = arg_index_from_name(key) if String === key
92
91
  key = key.to_i if key
93
- raise CORBA::BAD_PARAM.new('', 0, CORBA::COMPLETD_NO) unless key && (key>=0) && (key<@arg_.size)
92
+ raise CORBA::BAD_PARAM.new('', 0, CORBA::COMPLETD_NO) unless key && (key >= 0) && (key < @arg_.size)
94
93
  jnv = @nvlist_.item(key)
95
94
  rtc = @arg_list_[key][2]
96
95
  CORBA::Any.to_any(val, rtc).to_java(self.orb_, jnv.value())
@@ -114,7 +113,7 @@ module R2CORBA
114
113
  unless arg_list.nil?
115
114
  arg_list.each do |argnm, argf, argtc|
116
115
  raise CORBA::BAD_PARAM.new('', 0, CORBA::COMPLETED_NO) if argf.nil? || argtc.nil? || !argtc.is_a?(CORBA::TypeCode)
117
- jnvlist.add_value(argnm.to_s, Any.to_any(nil,argtc).to_java(@orb_), argf.to_i)
116
+ jnvlist.add_value(argnm.to_s, Any.to_any(nil, argtc).to_java(@orb_), argf.to_i)
118
117
  end
119
118
  self.srvreq_.arguments(jnvlist)
120
119
  end
@@ -125,4 +124,4 @@ module R2CORBA
125
124
 
126
125
  end # CORBA
127
126
 
128
- end # R2CORBA
127
+ end # R2CORBA
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  module R2CORBA
@@ -58,7 +57,7 @@ module R2CORBA
58
57
  when TK_DOUBLE
59
58
  read_double()
60
59
  when TK_LONGDOUBLE
61
- raise CORBA::NO_IMPLEMENT.new('LongDouble not supported',0,CORBA::COMPLETED_NO)
60
+ raise CORBA::NO_IMPLEMENT.new('LongDouble not supported', 0, CORBA::COMPLETED_NO)
62
61
  when TK_FIXED
63
62
  read_fixed()
64
63
  when TK_CHAR
@@ -403,7 +402,7 @@ module R2CORBA
403
402
  when TK_DOUBLE
404
403
  write_double(value)
405
404
  when TK_LONGDOUBLE
406
- raise CORBA::NO_IMPLEMENT.new('LongDouble not supported',0,CORBA::COMPLETED_NO)
405
+ raise CORBA::NO_IMPLEMENT.new('LongDouble not supported', 0, CORBA::COMPLETED_NO)
407
406
  when TK_FIXED
408
407
  write_fixed(value)
409
408
  when TK_CHAR
@@ -610,7 +609,7 @@ module R2CORBA
610
609
  end
611
610
  def write_wstring(value)
612
611
  begin
613
- self.stream_.write_wstring(value.inject('') {|s,b| s << b.chr})
612
+ self.stream_.write_wstring(value.inject('') {|s, b| s << b.chr})
614
613
  rescue ::NativeException
615
614
  CORBA::Exception.native2r($!)
616
615
  end
@@ -668,4 +667,4 @@ module R2CORBA
668
667
  end
669
668
  end
670
669
  end
671
- end
670
+ end
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
  module R2CORBA
14
13
  module CORBA
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
  require "corba/jbase/Any.rb"
14
13
  require 'bigdecimal'
@@ -163,7 +162,7 @@ module R2CORBA
163
162
  content_tc = args.shift
164
163
  length = args
165
164
  raise ArgumentError, 'expected CORBA::TypeCode' unless content_tc.is_a?(CORBA::TypeCode)
166
- if length.size>1
165
+ if length.size > 1
167
166
  this_len = length.shift
168
167
  content_tc = self.class.new(content_tc, *length)
169
168
  else
@@ -232,12 +231,12 @@ module R2CORBA
232
231
  @members = []
233
232
  members_.each { |n, tc, access| add_member(n, tc, access) }
234
233
  jmembers = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::ValueMember.java_class, @members.size)
235
- @members.each_with_index do |(mn, mtc, access),i|
234
+ @members.each_with_index do |(mn, mtc, access), i|
236
235
  m_id = mtc.is_a?(IdentifiedTypeCode) ? mtc.id : 'IDL:*primitive*:1.0'
237
236
  jmembers[i] = CORBA::Native::ValueMember.new(mn.to_s, m_id,
238
237
  name, id.split(':').last,
239
238
  mtc.tc_, nil,
240
- access==:public ?
239
+ access == :public ?
241
240
  CORBA::PUBLIC_MEMBER :
242
241
  CORBA::PRIVATE_MEMBER)
243
242
  end
@@ -248,7 +247,7 @@ module R2CORBA
248
247
 
249
248
  protected
250
249
 
251
- def _create_tc(id,name,modifier,base,jmembers)
250
+ def _create_tc(id, name, modifier, base, jmembers)
252
251
  begin
253
252
  CORBA::ORB._orb.create_value_tc(id.to_s,
254
253
  name.to_s,
@@ -266,7 +265,7 @@ module R2CORBA
266
265
 
267
266
  protected
268
267
 
269
- def _create_tc(id,name,modifier,base,jmembers)
268
+ def _create_tc(id, name, modifier, base, jmembers)
270
269
  # JaCORB 2.3.1' does not support tk_event typecodes yet;
271
270
  # so just let it be a regular valuetype
272
271
  # NOTE: this will not be interoperable between jR2CORBA and R2CORBA
@@ -369,7 +368,7 @@ module R2CORBA
369
368
  @members = []
370
369
  members_.each { |n, tc| add_member(n, tc) }
371
370
  jmembers = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::StructMember.java_class, @members.size)
372
- @members.each_with_index {|(mn, mtc),i| jmembers[i] = CORBA::Native::StructMember.new(mn.to_s, mtc.tc_, nil) }
371
+ @members.each_with_index {|(mn, mtc), i| jmembers[i] = CORBA::Native::StructMember.new(mn.to_s, mtc.tc_, nil) }
373
372
  @tc_ = _create_tc(id, name, jmembers)
374
373
  super(id)
375
374
  end
@@ -377,7 +376,7 @@ module R2CORBA
377
376
 
378
377
  protected
379
378
 
380
- def _create_tc(id,name,jmembers)
379
+ def _create_tc(id, name, jmembers)
381
380
  begin
382
381
  CORBA::ORB._orb.create_struct_tc(id.to_s, name.to_s, jmembers)
383
382
  rescue ::NativeException
@@ -390,20 +389,20 @@ module R2CORBA
390
389
  class Except < Struct
391
390
 
392
391
  def from_java(jex)
393
- raise CORBA::BAD_PARAM.new('org.om.CORBA.UserException expected',0,CORBA::COMPLETED_NO) unless jex.is_a?(CORBA::Native::UserException)
392
+ raise CORBA::BAD_PARAM.new('org.om.CORBA.UserException expected', 0, CORBA::COMPLETED_NO) unless jex.is_a?(CORBA::Native::UserException)
394
393
  ex = get_type.new
395
- members.each {|mname,mtc| ex.__send__("#{mname}=".to_sym, jex.__send__(mname.to_sym)) }
394
+ members.each {|mname, mtc| ex.__send__("#{mname}=".to_sym, jex.__send__(mname.to_sym)) }
396
395
  ex
397
396
  end
398
397
 
399
398
  def is_compatible?(jex)
400
- raise CORBA::BAD_PARAM.new('org.om.CORBA.UserException expected',0,CORBA::COMPLETED_NO) unless jex.is_a?(CORBA::Native::UserException)
401
- members.all? {|mname,mtc| jex.respond_to?(mname.to_sym) }
399
+ raise CORBA::BAD_PARAM.new('org.om.CORBA.UserException expected', 0, CORBA::COMPLETED_NO) unless jex.is_a?(CORBA::Native::UserException)
400
+ members.all? {|mname, mtc| jex.respond_to?(mname.to_sym) }
402
401
  end
403
402
 
404
403
  protected
405
404
 
406
- def _create_tc(id,name,jmembers)
405
+ def _create_tc(id, name, jmembers)
407
406
  begin
408
407
  CORBA::ORB._orb.create_exception_tc(id.to_s, name.to_s, jmembers)
409
408
  rescue ::NativeException
@@ -424,7 +423,7 @@ module R2CORBA
424
423
  @members = []
425
424
  def_inx = @tc_.default_index
426
425
  @tc_.member_count.times do |i|
427
- if def_inx < 0 || def_inx != i
426
+ if def_inx < 0 || def_inx != i
428
427
  ml_ = Any.from_java(@tc_.member_label(i))
429
428
  else
430
429
  ml_ = :default
@@ -468,7 +467,7 @@ module R2CORBA
468
467
 
469
468
  protected
470
469
 
471
- def _create_tc(id,name, disctc,jmembers)
470
+ def _create_tc(id, name, disctc, jmembers)
472
471
  begin
473
472
  CORBA::ORB._orb.create_union_tc(id.to_s, name.to_s, disctc.tc_, jmembers)
474
473
  rescue ::NativeException
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  module R2CORBA
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  # import all java CORBA exceptions into the R2CORBA::CORBA namespace
@@ -83,7 +82,7 @@ module R2CORBA
83
82
  self.set_backtrace(args.first.backtrace) if NativeException === args.first
84
83
  else
85
84
  super(args.shift.to_s)
86
- @minor, @completed = (args + [0,0][args.size..2])
85
+ @minor, @completed = (args + [0, 0][args.size..2])
87
86
  end
88
87
  end
89
88
  end
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  module R2CORBA
@@ -37,7 +36,7 @@ module R2CORBA
37
36
  module POA
38
37
  def destroy(etherealize_objects, wait_for_completion)
39
38
  begin
40
- self.objref_.destroy(etherealize_objects!=false, wait_for_completion!=false)
39
+ self.objref_.destroy(etherealize_objects != false, wait_for_completion != false)
41
40
  rescue ::NativeException
42
41
  CORBA::Exception.native2r($!)
43
42
  end
@@ -167,7 +166,7 @@ module R2CORBA
167
166
  raise CORBA::BAD_PARAM.new('expected POAManager', 0, CORBA::COMPLETED_NO) unless a_POAManager.is_a?(PortableServer::POAManager)
168
167
  CORBA::PolicyList._tc.validate(policies) unless policies.nil? || policies.empty?
169
168
  jpolicies = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::Policy.java_class, policies.nil? ? 0 : policies.size)
170
- policies.each_with_index {|p,i| jpolicies[i] = p.objref_ } unless policies.nil?
169
+ policies.each_with_index {|p, i| jpolicies[i] = p.objref_ } unless policies.nil?
171
170
  begin
172
171
  PortableServer::POA._narrow(CORBA::Object._wrap_native(self.objref_.create_POA(adapter_name, a_POAManager.objref_, jpolicies)))
173
172
  rescue ::NativeException
@@ -226,4 +225,4 @@ module R2CORBA
226
225
  end # get_state
227
226
  end # POAManager
228
227
  end
229
- end
228
+ end
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  module R2CORBA
@@ -17,7 +16,7 @@ module R2CORBA
17
16
 
18
17
  module ORB
19
18
  def create_policy(type, val)
20
- raise CORBA::BAD_PARAM.new('Any expected',0,CORBA::COMPLETED_NO) unless CORBA::Any === val
19
+ raise CORBA::BAD_PARAM.new('Any expected', 0, CORBA::COMPLETED_NO) unless CORBA::Any === val
21
20
  begin
22
21
  Policy._wrap_native(self.orb_.create_policy(type.to_i, val.to_java(self.orb_)))
23
22
  rescue ::NativeException
@@ -59,7 +58,7 @@ module R2CORBA
59
58
  def _set_policy_overrides(policies, set_add)
60
59
  raise CORBA::INV_OBJREF.new if self._is_nil?()
61
60
  jpolicies = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::Policy.java_class, policies.size)
62
- policies.each_with_index {|e,i| jpolicies[i] = e.objref_ }
61
+ policies.each_with_index {|e, i| jpolicies[i] = e.objref_ }
63
62
  begin
64
63
  obj = self.objref_._set_policy_override(jpolicies, Native::SetOverrideType.from_int(set_add))
65
64
  rescue ::NativeException
@@ -126,7 +125,7 @@ module R2CORBA
126
125
 
127
126
  def set_policy_overrides(policies, set_add)
128
127
  jpolicies = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::Policy.java_class, policies.size)
129
- policies.each_with_index {|e,i| jpolicies[i] = e.objref_ }
128
+ policies.each_with_index {|e, i| jpolicies[i] = e.objref_ }
130
129
  begin
131
130
  self.objref_.set_policy_overrides(jpolicies, Native::SetOverrideType.from_int(set_add))
132
131
  rescue ::NativeException
@@ -297,4 +296,4 @@ module R2CORBA
297
296
 
298
297
  end # BiDirPolicy
299
298
 
300
- end # R2CORBA
299
+ end # R2CORBA
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  require 'corba/jbase/IORMap'
@@ -8,24 +8,26 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
  require 'rbconfig'
14
13
  require 'java'
15
14
 
16
15
  module R2CORBA
17
- if ENV['JACORB_HOME'] && File.exists?(File.join(ENV['JACORB_HOME'], 'lib', 'jacorb.jar'))
16
+ if ENV['JACORB_HOME'] &&
17
+ (File.exist?(File.join(ENV['JACORB_HOME'], 'lib', 'jacorb.jar')) ||
18
+ Dir[File.join(ENV['JACORB_HOME'], 'lib', 'jacorb-*.jar')].any? {|p| p =~ /\/jacorb\-\d\.\d\.jar\Z/})
18
19
  JACORB_HOME = ENV['JACORB_HOME']
19
20
  else
20
21
  # find jacorb.jar in library search path
21
- JACORB_HOME = File.dirname(($:.find { |path| File.exists?(File.join(path, 'jacorb.jar')) }).to_s)
22
+ JACORB_HOME = File.dirname(($:.find { |path| Dir[File.join(path, 'jacorb-*.jar')].any? {|p| p =~ /\/jacorb(\.jar|\-\d\.\d\.jar)\Z/} }).to_s)
22
23
  end
23
24
 
24
25
  $LOAD_PATH << File.join(JACORB_HOME, 'lib')
25
26
  module JavaLang
26
27
  include_package 'java.lang'
27
- prop = System.getProperties['java.endorsed.dirs']
28
- System.setProperty('java.endorsed.dirs', "#{File.join(R2CORBA::JACORB_HOME, 'lib')}:#{prop}")
28
+ ## Only works if passed as Java commandline arg
29
+ # prop = System.getProperties['java.endorsed.dirs']
30
+ # System.setProperty('java.endorsed.dirs', "#{File.join(R2CORBA::JACORB_HOME, 'lib')}:#{prop}")
29
31
  System.setProperty('jacorb.home', "#{R2CORBA::JACORB_HOME}")
30
32
  System.setProperty('org.omg.CORBA.ORBClass', 'org.jacorb.orb.ORB')
31
33
  System.setProperty('org.omg.CORBA.ORBSingletonClass', 'org.jacorb.orb.ORBSingleton')
data/lib/corba/naming.rb CHANGED
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  require 'corba/idl/CosNamingC'
@@ -8,7 +8,6 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  require 'corba/naming.rb'
data/lib/corba/poa.rb CHANGED
@@ -8,8 +8,7 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  require 'corba.rb'
15
- require "corba/#{defined?(JRUBY_VERSION)?'jbase':'cbase'}/poa.rb"
14
+ require "corba/#{defined?(JRUBY_VERSION) ? 'jbase' : 'cbase'}/poa.rb"
@@ -8,11 +8,10 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  require 'corba.rb'
15
14
  require 'corba/poa.rb'
16
15
  require 'corba/idl/BiDirPolicyC'
17
16
  require 'corba/idl/MessagingC'
18
- require "corba/#{defined?(JRUBY_VERSION)?'jbase':'cbase'}/policies.rb"
17
+ require "corba/#{defined?(JRUBY_VERSION) ? 'jbase' : 'cbase'}/policies.rb"
data/lib/corba/require.rb CHANGED
@@ -8,10 +8,9 @@
8
8
  # included with this program.
9
9
  #
10
10
  # Copyright (c) Remedy IT Expertise BV
11
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
11
  #--------------------------------------------------------------------
13
12
 
14
13
  require 'corba/common/require'
15
- require "corba/#{defined?(JRUBY_VERSION)?'jbase':'cbase'}/require"
14
+ require "corba/#{defined?(JRUBY_VERSION) ? 'jbase' : 'cbase'}/require"
16
15
  require 'corba/idl/require'
17
- require "corba/#{defined?(JRUBY_VERSION)?'jbase':'cbase'}/post_require"
16
+ require "corba/#{defined?(JRUBY_VERSION) ? 'jbase' : 'cbase'}/post_require"
@@ -1,21 +1,18 @@
1
1
  #--------------------------------------------------------------------
2
2
  # cos_naming.rb - Implementation of CosNaming servants
3
- # for full featured naming service
3
+ # for full featured naming service
4
4
  #
5
5
  # Author: Martin Corino
6
6
  #
7
- # $Id: $
8
- #
9
7
  # This program is free software; you can redistribute it and/or
10
8
  # modify it under the terms of the R2CORBA LICENSE which is
11
9
  # included with this program.
12
10
  #
13
11
  # Copyright (c) Remedy IT Expertise BV
14
- # Chamber of commerce Rotterdam nr.276339, The Netherlands
15
12
  #--------------------------------------------------------------------
16
13
 
17
14
  require 'corba/naming_service'
18
- if (defined?(JRUBY_VERSION) or R2CORBA::TAO::RUBY_THREAD_SUPPORT)
15
+ if defined?(JRUBY_VERSION) or R2CORBA::TAO::RUBY_THREAD_SUPPORT
19
16
  require 'monitor'
20
17
  end
21
18
 
@@ -29,12 +26,12 @@ module CosNaming
29
26
  # convert NameComponent to stringified format according to spec
30
27
  def to_string
31
28
  s = ''
32
- s = self.r_id.gsub(/([\/\.\\])/,'\\\1') unless self.r_id.to_s.empty?
29
+ s = self.r_id.gsub(/([\/\.\\])/, '\\\1') unless self.r_id.to_s.empty?
33
30
  s << '.' if s.empty? or !self.kind.to_s.empty?
34
- s << self.kind.gsub(/([\/\.\\])/,'\\\1') unless self.kind.to_s.empty?
31
+ s << self.kind.gsub(/([\/\.\\])/, '\\\1') unless self.kind.to_s.empty?
35
32
  s
36
33
  end
37
- # convert stringified name back to NameComponent
34
+ # convert stringified name back to NameComponent
38
35
  def self.from_string(snc)
39
36
  raise CosNaming::NamingContext::InvalidName.new if snc.empty?
40
37
  esc_ = false
@@ -46,9 +43,9 @@ module CosNaming
46
43
  esc_ = !esc_
47
44
  when '.'
48
45
  unless esc_
49
- raise CosNaming::NamingContext::InvalidName.new if off_>0
46
+ raise CosNaming::NamingContext::InvalidName.new if off_ > 0
50
47
  id_ = snc[0, i].gsub(/\\(\.|\\)/, '\1')
51
- off_ = i+1
48
+ off_ = i + 1
52
49
  end
53
50
  esc_ = false
54
51
  else
@@ -63,7 +60,7 @@ end
63
60
 
64
61
  module R2CORBA
65
62
  module INS
66
-
63
+
67
64
  ##
68
65
  # Binding iterator servant class
69
66
  #
@@ -72,25 +69,25 @@ module R2CORBA
72
69
  @rl = reglist
73
70
  @id = iterator_id
74
71
  end
75
-
72
+
76
73
  attr_accessor :oid
77
-
74
+
78
75
  def next_one
79
76
  reg = @rl.shift
80
77
  [!reg.nil?, reg ? CosNaming::Binding.new(reg[:name], reg[:type]) : nil]
81
78
  end
82
-
79
+
83
80
  def next_n(how_many)
84
81
  raise CORBA::BAD_PARAM.new if how_many < 1
85
82
  bindings = []
86
- while how_many>0 and !@rl.empty?
83
+ while how_many > 0 and !@rl.empty?
87
84
  reg = @rl.shift
88
85
  bindings << CosNaming::Binding.new(reg[:name], reg[:type])
89
86
  how_many -= 1
90
87
  end
91
88
  [!bindings.empty?, bindings]
92
89
  end
93
-
90
+
94
91
  def destroy
95
92
  poa = self._default_POA
96
93
  poa.deactivate_object(self.oid)
@@ -103,11 +100,11 @@ module R2CORBA
103
100
  # Naming context servant class
104
101
  #
105
102
  class NamingContext < POA::CosNaming::NamingContextExt
106
-
103
+
107
104
  # Map type to store bindings.
108
105
  # Use synchronized version for multithreading capable implementations.
109
106
  #
110
- if (defined?(JRUBY_VERSION) or R2CORBA::TAO::RUBY_THREAD_SUPPORT)
107
+ if defined?(JRUBY_VERSION) or R2CORBA::TAO::RUBY_THREAD_SUPPORT
111
108
  MAP_TYPE = Class.new(Monitor) do
112
109
  def initialize
113
110
  super
@@ -167,18 +164,18 @@ module R2CORBA
167
164
  end
168
165
  end
169
166
  end
170
-
167
+
171
168
  @@iterators = MAP_TYPE.new
172
169
  @@iterator_max = 100
173
-
170
+
174
171
  def self.set_iterator_max(max)
175
172
  @@iterator_max = max.to_i
176
173
  end
177
-
174
+
178
175
  def self.clear_iterator(id)
179
- @@iterators.delete(id)
176
+ @@iterators.delete(id)
180
177
  end
181
-
178
+
182
179
  def self.alloc_iterator(reglist)
183
180
  @@iterators.synchronize do
184
181
  unless @@iterators.size < @@iterator_max
@@ -189,64 +186,64 @@ module R2CORBA
189
186
  return (@@iterators[itid] = INS::BindingIterator.new(reglist, itid))
190
187
  end
191
188
  end
192
-
189
+
193
190
  def initialize(orb)
194
- @orb = orb
191
+ @orb = orb
195
192
  @map = MAP_TYPE.new
196
193
  end
197
-
194
+
198
195
  attr_accessor :oid
199
-
196
+
200
197
  # CosNaming::NamingContext methods
201
198
  #
202
199
  def bind(n, obj)
203
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
204
- if n.size>1
200
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
201
+ if n.size > 1
205
202
  nc = find_context(n)
206
203
  nc.bind(n, obj)
207
204
  else
208
205
  register_object(n.first, n, CosNaming::Nobject, obj)
209
206
  end
210
207
  end
211
-
208
+
212
209
  def rebind(n, obj)
213
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
214
- if n.size>1
210
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
211
+ if n.size > 1
215
212
  nc = find_context(n)
216
213
  nc.rebind(n, obj)
217
214
  else
218
215
  reregister_object(n.first, n, CosNaming::Nobject, obj)
219
216
  end
220
217
  end
221
-
218
+
222
219
  def bind_context(n, nc_new)
223
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
224
- if n.size>1
220
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
221
+ if n.size > 1
225
222
  nc = find_context(n)
226
223
  nc.bind_context(n, nc_new)
227
224
  else
228
225
  register_object(n.first, n, CosNaming::Ncontext, nc_new)
229
226
  end
230
227
  end
231
-
228
+
232
229
  def rebind_context(n, nc_new)
233
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
234
- if n.size>1
230
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
231
+ if n.size > 1
235
232
  nc = find_context(n)
236
233
  nc.rebind_context(n, nc_new)
237
234
  else
238
235
  reregister_object(n.first, n, CosNaming::Ncontext, nc_new)
239
236
  end
240
237
  end
241
-
238
+
242
239
  def resolve(n)
243
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
240
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
244
241
  find_object(n)
245
242
  end
246
-
243
+
247
244
  def unbind(n)
248
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
249
- if n.size>1
245
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
246
+ if n.size > 1
250
247
  nc = find_context(n)
251
248
  nc.unbind(n)
252
249
  else
@@ -257,33 +254,33 @@ module R2CORBA
257
254
  end
258
255
  end
259
256
  end
260
-
257
+
261
258
  def new_context()
262
259
  poa = self._default_POA
263
260
  naming_srv = NamingContext.new(@orb)
264
261
  naming_srv.oid = poa.activate_object(naming_srv)
265
262
  ::CosNaming::NamingContextExt::_narrow(poa.id_to_reference(naming_srv.oid))
266
263
  end
267
-
264
+
268
265
  def bind_new_context(n)
269
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
266
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
270
267
  nc = self.new_context()
271
268
  self.bind_context(n, nc)
272
269
  nc
273
270
  end
274
-
271
+
275
272
  def destroy()
276
- raise CosNaming::NamingContext::NotEmpty.new if @map.size>0
273
+ raise CosNaming::NamingContext::NotEmpty.new if @map.size > 0
277
274
  return if self.oid.nil? ## no oid for root context
278
275
  poa = self._default_POA
279
276
  poa.deactivate_object(self.oid)
280
277
  @orb = nil
281
278
  end
282
-
279
+
283
280
  def list(how_many)
284
281
  reglist = @map.values
285
282
  bindings = []
286
- while how_many>0 and !reglist.empty?
283
+ while how_many > 0 and !reglist.empty?
287
284
  reg = reglist.shift
288
285
  bindings << CosNaming::Binding.new(reg[:name], reg[:type])
289
286
  how_many -= 1
@@ -297,27 +294,27 @@ module R2CORBA
297
294
  end
298
295
  [bindings, CosNaming::BindingIterator._narrow(bi_obj)]
299
296
  end
300
-
297
+
301
298
  # CosNaming::NamingContextExt methods
302
299
  #
303
300
  def to_string(n)
304
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
301
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
305
302
  n.collect { |nc| nc.to_string }.join('/')
306
303
  end
307
-
304
+
308
305
  def to_name(sn)
309
306
  raise CosNaming::NamingContext::InvalidName.new if sn.to_s.empty?
310
307
  snc_arr = []
311
308
  off_ = 0
312
309
  esc_ = false
313
310
  sn.size.times do |i|
314
- case sn[i,1]
311
+ case sn[i, 1]
315
312
  when '\\'
316
- esc_ = !esc_
313
+ esc_ = !esc_
317
314
  when '/'
318
315
  unless esc_
319
- snc_arr << sn[off_, i-off_]
320
- off_ = i+1
316
+ snc_arr << sn[off_, i - off_]
317
+ off_ = i + 1
321
318
  end
322
319
  esc_ = false
323
320
  else
@@ -327,10 +324,10 @@ module R2CORBA
327
324
  snc_arr << sn[off_, sn.size]
328
325
  [snc_arr.collect { |snc| CosNaming::NameComponent.from_string(snc) }]
329
326
  end
330
-
327
+
331
328
  def to_url(addr, sn)
332
329
  raise CosNaming::NamingContext::InvalidName.new if addr.to_s.empty? or sn.to_s.empty?
333
- url = 'corbaname:'+addr+'#'
330
+ url = 'corbaname:' + addr + '#'
334
331
  sn.scan(/./) do |ch|
335
332
  if /[a-zA-Z0-9;\/:\?@=+\$,\-_\.!~*\'\(\)]/ =~ ch
336
333
  url << ch
@@ -340,7 +337,7 @@ module R2CORBA
340
337
  end
341
338
  url
342
339
  end
343
-
340
+
344
341
  def resolve_str(sn)
345
342
  self.resolve(self.to_name(sn).first)
346
343
  end
@@ -348,7 +345,7 @@ module R2CORBA
348
345
  # Helper methods
349
346
  #
350
347
  protected
351
-
348
+
352
349
  # register the object reference for a certain NameComponent id
353
350
  # no reregistering or duplicates allowed
354
351
  #
@@ -363,7 +360,7 @@ module R2CORBA
363
360
  }
364
361
  end
365
362
  end
366
-
363
+
367
364
  # reregister the object reference for a certain NameComponent id
368
365
  #
369
366
  def reregister_object(name, full_name, type, obj)
@@ -380,7 +377,7 @@ module R2CORBA
380
377
  }
381
378
  end
382
379
  end
383
-
380
+
384
381
  # walk all segments of the given CosNaming::Name to find the object
385
382
  # bound by this full name
386
383
  # NOTE that #find_context is used when the Name contains > 1 level
@@ -388,7 +385,7 @@ module R2CORBA
388
385
  # resolving the context levels
389
386
  #
390
387
  def find_object(n)
391
- if n.size>1
388
+ if n.size > 1
392
389
  nc = find_context(n)
393
390
  nc.resolve(n)
394
391
  else
@@ -400,7 +397,7 @@ module R2CORBA
400
397
  end
401
398
  end
402
399
  end
403
-
400
+
404
401
  # check if there exists a naming context in the current context
405
402
  # with the id from the first segment of the given CosNaming::Name
406
403
  # return the object reference to the naming context if found
@@ -419,8 +416,8 @@ module R2CORBA
419
416
  @map[key_][:object]
420
417
  end
421
418
  end
422
-
419
+
423
420
  end #of NamingContext servant
424
-
421
+
425
422
  end
426
423
  end