zeroc-ice 3.6b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (675) hide show
  1. checksums.yaml +7 -0
  2. data/ICE_LICENSE +54 -0
  3. data/LICENSE +339 -0
  4. data/bin/slice2rb +17 -0
  5. data/ext/Communicator.cpp +596 -0
  6. data/ext/Communicator.h +25 -0
  7. data/ext/Config.h +111 -0
  8. data/ext/Connection.cpp +381 -0
  9. data/ext/Connection.h +26 -0
  10. data/ext/Endpoint.cpp +311 -0
  11. data/ext/Endpoint.h +27 -0
  12. data/ext/ImplicitContext.cpp +152 -0
  13. data/ext/ImplicitContext.h +25 -0
  14. data/ext/Init.cpp +52 -0
  15. data/ext/Logger.cpp +151 -0
  16. data/ext/Logger.h +28 -0
  17. data/ext/ObjectFactory.cpp +140 -0
  18. data/ext/ObjectFactory.h +50 -0
  19. data/ext/Operation.cpp +676 -0
  20. data/ext/Operation.h +36 -0
  21. data/ext/Properties.cpp +369 -0
  22. data/ext/Properties.h +25 -0
  23. data/ext/Proxy.cpp +1354 -0
  24. data/ext/Proxy.h +27 -0
  25. data/ext/Slice.cpp +223 -0
  26. data/ext/Slice.h +22 -0
  27. data/ext/Types.cpp +3160 -0
  28. data/ext/Types.h +545 -0
  29. data/ext/Util.cpp +792 -0
  30. data/ext/Util.h +511 -0
  31. data/ext/extconf.rb +118 -0
  32. data/ext/ice/BZIP_LICENSE +42 -0
  33. data/ext/ice/MCPP_LICENSE +36 -0
  34. data/ext/ice/bzip2/blocksort.c +1094 -0
  35. data/ext/ice/bzip2/bzlib.c +1572 -0
  36. data/ext/ice/bzip2/bzlib.h +282 -0
  37. data/ext/ice/bzip2/bzlib_private.h +509 -0
  38. data/ext/ice/bzip2/compress.c +672 -0
  39. data/ext/ice/bzip2/crctable.c +104 -0
  40. data/ext/ice/bzip2/decompress.c +646 -0
  41. data/ext/ice/bzip2/huffman.c +205 -0
  42. data/ext/ice/bzip2/randtable.c +84 -0
  43. data/ext/ice/cpp/include/Ice/ACMF.h +30 -0
  44. data/ext/ice/cpp/include/Ice/Application.h +156 -0
  45. data/ext/ice/cpp/include/Ice/AsyncResult.h +363 -0
  46. data/ext/ice/cpp/include/Ice/AsyncResultF.h +26 -0
  47. data/ext/ice/cpp/include/Ice/BasicStream.h +1315 -0
  48. data/ext/ice/cpp/include/Ice/Buffer.h +159 -0
  49. data/ext/ice/cpp/include/Ice/BuiltinSequences.h +74 -0
  50. data/ext/ice/cpp/include/Ice/Communicator.h +194 -0
  51. data/ext/ice/cpp/include/Ice/CommunicatorAsync.h +115 -0
  52. data/ext/ice/cpp/include/Ice/CommunicatorF.h +60 -0
  53. data/ext/ice/cpp/include/Ice/Config.h +97 -0
  54. data/ext/ice/cpp/include/Ice/Connection.h +495 -0
  55. data/ext/ice/cpp/include/Ice/ConnectionAsync.h +115 -0
  56. data/ext/ice/cpp/include/Ice/ConnectionF.h +72 -0
  57. data/ext/ice/cpp/include/Ice/ConnectionFactoryF.h +30 -0
  58. data/ext/ice/cpp/include/Ice/ConnectionIF.h +37 -0
  59. data/ext/ice/cpp/include/Ice/Current.h +94 -0
  60. data/ext/ice/cpp/include/Ice/DefaultObjectFactory.h +48 -0
  61. data/ext/ice/cpp/include/Ice/DeprecatedStringConverter.h +62 -0
  62. data/ext/ice/cpp/include/Ice/DispatchInterceptor.h +33 -0
  63. data/ext/ice/cpp/include/Ice/Dispatcher.h +51 -0
  64. data/ext/ice/cpp/include/Ice/DynamicLibrary.h +105 -0
  65. data/ext/ice/cpp/include/Ice/DynamicLibraryF.h +29 -0
  66. data/ext/ice/cpp/include/Ice/Endpoint.h +350 -0
  67. data/ext/ice/cpp/include/Ice/EndpointF.h +97 -0
  68. data/ext/ice/cpp/include/Ice/EndpointTypes.h +74 -0
  69. data/ext/ice/cpp/include/Ice/Exception.h +114 -0
  70. data/ext/ice/cpp/include/Ice/FacetMap.h +56 -0
  71. data/ext/ice/cpp/include/Ice/FactoryTable.h +69 -0
  72. data/ext/ice/cpp/include/Ice/FactoryTableInit.h +87 -0
  73. data/ext/ice/cpp/include/Ice/Format.h +39 -0
  74. data/ext/ice/cpp/include/Ice/Functional.h +138 -0
  75. data/ext/ice/cpp/include/Ice/GCObject.h +73 -0
  76. data/ext/ice/cpp/include/Ice/Handle.h +192 -0
  77. data/ext/ice/cpp/include/Ice/Ice.h +54 -0
  78. data/ext/ice/cpp/include/Ice/Identity.h +160 -0
  79. data/ext/ice/cpp/include/Ice/ImplicitContext.h +96 -0
  80. data/ext/ice/cpp/include/Ice/ImplicitContextF.h +60 -0
  81. data/ext/ice/cpp/include/Ice/Incoming.h +131 -0
  82. data/ext/ice/cpp/include/Ice/IncomingAsync.h +108 -0
  83. data/ext/ice/cpp/include/Ice/IncomingAsyncF.h +35 -0
  84. data/ext/ice/cpp/include/Ice/Initialize.h +141 -0
  85. data/ext/ice/cpp/include/Ice/InstanceF.h +26 -0
  86. data/ext/ice/cpp/include/Ice/Instrumentation.h +377 -0
  87. data/ext/ice/cpp/include/Ice/InstrumentationF.h +71 -0
  88. data/ext/ice/cpp/include/Ice/LocalException.h +1022 -0
  89. data/ext/ice/cpp/include/Ice/LocalObject.h +36 -0
  90. data/ext/ice/cpp/include/Ice/LocalObjectF.h +26 -0
  91. data/ext/ice/cpp/include/Ice/Locator.h +2191 -0
  92. data/ext/ice/cpp/include/Ice/LocatorF.h +89 -0
  93. data/ext/ice/cpp/include/Ice/Logger.h +94 -0
  94. data/ext/ice/cpp/include/Ice/LoggerF.h +60 -0
  95. data/ext/ice/cpp/include/Ice/LoggerUtil.h +153 -0
  96. data/ext/ice/cpp/include/Ice/Makefile +26 -0
  97. data/ext/ice/cpp/include/Ice/Metrics.h +2989 -0
  98. data/ext/ice/cpp/include/Ice/MetricsAdminI.h +662 -0
  99. data/ext/ice/cpp/include/Ice/MetricsFunctional.h +144 -0
  100. data/ext/ice/cpp/include/Ice/MetricsObserverI.h +576 -0
  101. data/ext/ice/cpp/include/Ice/NativePropertiesAdmin.h +55 -0
  102. data/ext/ice/cpp/include/Ice/Object.h +165 -0
  103. data/ext/ice/cpp/include/Ice/ObjectAdapter.h +162 -0
  104. data/ext/ice/cpp/include/Ice/ObjectAdapterF.h +60 -0
  105. data/ext/ice/cpp/include/Ice/ObjectAdapterFactoryF.h +26 -0
  106. data/ext/ice/cpp/include/Ice/ObjectF.h +26 -0
  107. data/ext/ice/cpp/include/Ice/ObjectFactory.h +86 -0
  108. data/ext/ice/cpp/include/Ice/ObjectFactoryF.h +60 -0
  109. data/ext/ice/cpp/include/Ice/ObjectFactoryManagerF.h +26 -0
  110. data/ext/ice/cpp/include/Ice/ObserverHelper.h +177 -0
  111. data/ext/ice/cpp/include/Ice/Outgoing.h +197 -0
  112. data/ext/ice/cpp/include/Ice/OutgoingAsync.h +264 -0
  113. data/ext/ice/cpp/include/Ice/OutgoingAsyncF.h +38 -0
  114. data/ext/ice/cpp/include/Ice/Plugin.h +121 -0
  115. data/ext/ice/cpp/include/Ice/PluginF.h +66 -0
  116. data/ext/ice/cpp/include/Ice/Process.h +568 -0
  117. data/ext/ice/cpp/include/Ice/ProcessF.h +77 -0
  118. data/ext/ice/cpp/include/Ice/Properties.h +130 -0
  119. data/ext/ice/cpp/include/Ice/PropertiesAdmin.h +824 -0
  120. data/ext/ice/cpp/include/Ice/PropertiesF.h +83 -0
  121. data/ext/ice/cpp/include/Ice/Protocol.h +242 -0
  122. data/ext/ice/cpp/include/Ice/Proxy.h +2448 -0
  123. data/ext/ice/cpp/include/Ice/ProxyF.h +78 -0
  124. data/ext/ice/cpp/include/Ice/ProxyFactoryF.h +26 -0
  125. data/ext/ice/cpp/include/Ice/ProxyHandle.h +330 -0
  126. data/ext/ice/cpp/include/Ice/ReferenceF.h +34 -0
  127. data/ext/ice/cpp/include/Ice/RemoteLogger.h +1496 -0
  128. data/ext/ice/cpp/include/Ice/RequestHandlerF.h +29 -0
  129. data/ext/ice/cpp/include/Ice/ResponseHandlerF.h +25 -0
  130. data/ext/ice/cpp/include/Ice/Router.h +1155 -0
  131. data/ext/ice/cpp/include/Ice/RouterF.h +77 -0
  132. data/ext/ice/cpp/include/Ice/ServantLocator.h +90 -0
  133. data/ext/ice/cpp/include/Ice/ServantLocatorF.h +60 -0
  134. data/ext/ice/cpp/include/Ice/ServantManagerF.h +26 -0
  135. data/ext/ice/cpp/include/Ice/Service.h +260 -0
  136. data/ext/ice/cpp/include/Ice/SliceChecksumDict.h +56 -0
  137. data/ext/ice/cpp/include/Ice/SliceChecksums.h +34 -0
  138. data/ext/ice/cpp/include/Ice/SlicedData.h +103 -0
  139. data/ext/ice/cpp/include/Ice/SlicedDataF.h +34 -0
  140. data/ext/ice/cpp/include/Ice/Stream.h +449 -0
  141. data/ext/ice/cpp/include/Ice/StreamF.h +30 -0
  142. data/ext/ice/cpp/include/Ice/StreamHelpers.h +877 -0
  143. data/ext/ice/cpp/include/Ice/ThreadPoolF.h +28 -0
  144. data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +56 -0
  145. data/ext/ice/cpp/include/Ice/Version.h +254 -0
  146. data/ext/ice/cpp/include/IceSSL/Config.h +23 -0
  147. data/ext/ice/cpp/include/IceSSL/ConnectionInfo.h +119 -0
  148. data/ext/ice/cpp/include/IceSSL/EndpointInfo.h +101 -0
  149. data/ext/ice/cpp/include/IceSSL/IceSSL.h +22 -0
  150. data/ext/ice/cpp/include/IceSSL/Makefile +26 -0
  151. data/ext/ice/cpp/include/IceSSL/Plugin.h +558 -0
  152. data/ext/ice/cpp/include/IceUtil/AbstractMutex.h +119 -0
  153. data/ext/ice/cpp/include/IceUtil/Cache.h +362 -0
  154. data/ext/ice/cpp/include/IceUtil/Cond.h +323 -0
  155. data/ext/ice/cpp/include/IceUtil/Config.h +234 -0
  156. data/ext/ice/cpp/include/IceUtil/CountDownLatch.h +50 -0
  157. data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +70 -0
  158. data/ext/ice/cpp/include/IceUtil/DisableWarnings.h +45 -0
  159. data/ext/ice/cpp/include/IceUtil/Exception.h +184 -0
  160. data/ext/ice/cpp/include/IceUtil/Functional.h +389 -0
  161. data/ext/ice/cpp/include/IceUtil/Handle.h +266 -0
  162. data/ext/ice/cpp/include/IceUtil/IceUtil.h +51 -0
  163. data/ext/ice/cpp/include/IceUtil/IconvStringConverter.h +302 -0
  164. data/ext/ice/cpp/include/IceUtil/InputUtil.h +47 -0
  165. data/ext/ice/cpp/include/IceUtil/Iterator.h +36 -0
  166. data/ext/ice/cpp/include/IceUtil/Lock.h +135 -0
  167. data/ext/ice/cpp/include/IceUtil/Makefile +26 -0
  168. data/ext/ice/cpp/include/IceUtil/Monitor.h +249 -0
  169. data/ext/ice/cpp/include/IceUtil/Mutex.h +357 -0
  170. data/ext/ice/cpp/include/IceUtil/MutexProtocol.h +28 -0
  171. data/ext/ice/cpp/include/IceUtil/MutexPtrLock.h +83 -0
  172. data/ext/ice/cpp/include/IceUtil/MutexPtrTryLock.h +82 -0
  173. data/ext/ice/cpp/include/IceUtil/Optional.h +322 -0
  174. data/ext/ice/cpp/include/IceUtil/Options.h +141 -0
  175. data/ext/ice/cpp/include/IceUtil/OutputUtil.h +362 -0
  176. data/ext/ice/cpp/include/IceUtil/PopDisableWarnings.h +19 -0
  177. data/ext/ice/cpp/include/IceUtil/PushDisableWarnings.h +26 -0
  178. data/ext/ice/cpp/include/IceUtil/Random.h +24 -0
  179. data/ext/ice/cpp/include/IceUtil/RecMutex.h +113 -0
  180. data/ext/ice/cpp/include/IceUtil/SHA1.h +65 -0
  181. data/ext/ice/cpp/include/IceUtil/ScannerConfig.h +44 -0
  182. data/ext/ice/cpp/include/IceUtil/ScopedArray.h +97 -0
  183. data/ext/ice/cpp/include/IceUtil/Shared.h +168 -0
  184. data/ext/ice/cpp/include/IceUtil/StringConverter.h +175 -0
  185. data/ext/ice/cpp/include/IceUtil/StringUtil.h +91 -0
  186. data/ext/ice/cpp/include/IceUtil/Thread.h +181 -0
  187. data/ext/ice/cpp/include/IceUtil/ThreadException.h +108 -0
  188. data/ext/ice/cpp/include/IceUtil/Time.h +209 -0
  189. data/ext/ice/cpp/include/IceUtil/Timer.h +143 -0
  190. data/ext/ice/cpp/include/IceUtil/UUID.h +22 -0
  191. data/ext/ice/cpp/include/IceUtil/UndefSysMacros.h +42 -0
  192. data/ext/ice/cpp/include/IceUtil/UniquePtr.h +101 -0
  193. data/ext/ice/cpp/include/Slice/CPlusPlusUtil.h +64 -0
  194. data/ext/ice/cpp/include/Slice/Checksum.h +26 -0
  195. data/ext/ice/cpp/include/Slice/CsUtil.h +92 -0
  196. data/ext/ice/cpp/include/Slice/DotNetNames.h +34 -0
  197. data/ext/ice/cpp/include/Slice/FileTracker.h +71 -0
  198. data/ext/ice/cpp/include/Slice/JavaUtil.h +277 -0
  199. data/ext/ice/cpp/include/Slice/Makefile +26 -0
  200. data/ext/ice/cpp/include/Slice/PHPUtil.h +50 -0
  201. data/ext/ice/cpp/include/Slice/Parser.h +1116 -0
  202. data/ext/ice/cpp/include/Slice/Preprocessor.h +68 -0
  203. data/ext/ice/cpp/include/Slice/PythonUtil.h +64 -0
  204. data/ext/ice/cpp/include/Slice/RubyUtil.h +54 -0
  205. data/ext/ice/cpp/include/Slice/Util.h +33 -0
  206. data/ext/ice/cpp/src/Ice/ACM.cpp +343 -0
  207. data/ext/ice/cpp/src/Ice/ACM.h +117 -0
  208. data/ext/ice/cpp/src/Ice/Acceptor.cpp +16 -0
  209. data/ext/ice/cpp/src/Ice/Acceptor.h +41 -0
  210. data/ext/ice/cpp/src/Ice/AcceptorF.h +30 -0
  211. data/ext/ice/cpp/src/Ice/Application.cpp +760 -0
  212. data/ext/ice/cpp/src/Ice/AsyncResult.cpp +599 -0
  213. data/ext/ice/cpp/src/Ice/Base64.cpp +269 -0
  214. data/ext/ice/cpp/src/Ice/Base64.h +36 -0
  215. data/ext/ice/cpp/src/Ice/BasicStream.cpp +3393 -0
  216. data/ext/ice/cpp/src/Ice/Buffer.cpp +98 -0
  217. data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +34 -0
  218. data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +718 -0
  219. data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.h +106 -0
  220. data/ext/ice/cpp/src/Ice/Communicator.cpp +45 -0
  221. data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +38 -0
  222. data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +386 -0
  223. data/ext/ice/cpp/src/Ice/CommunicatorI.h +112 -0
  224. data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +546 -0
  225. data/ext/ice/cpp/src/Ice/ConnectRequestHandler.h +97 -0
  226. data/ext/ice/cpp/src/Ice/Connection.cpp +58 -0
  227. data/ext/ice/cpp/src/Ice/ConnectionF.cpp +38 -0
  228. data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +1639 -0
  229. data/ext/ice/cpp/src/Ice/ConnectionFactory.h +236 -0
  230. data/ext/ice/cpp/src/Ice/ConnectionI.cpp +3876 -0
  231. data/ext/ice/cpp/src/Ice/ConnectionI.h +364 -0
  232. data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +115 -0
  233. data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.h +50 -0
  234. data/ext/ice/cpp/src/Ice/Connector.cpp +16 -0
  235. data/ext/ice/cpp/src/Ice/Connector.h +36 -0
  236. data/ext/ice/cpp/src/Ice/ConnectorF.h +26 -0
  237. data/ext/ice/cpp/src/Ice/Current.cpp +38 -0
  238. data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +168 -0
  239. data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.h +57 -0
  240. data/ext/ice/cpp/src/Ice/DefaultsAndOverridesF.h +26 -0
  241. data/ext/ice/cpp/src/Ice/DeprecatedStringConverter.cpp +60 -0
  242. data/ext/ice/cpp/src/Ice/DispatchInterceptor.cpp +49 -0
  243. data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +281 -0
  244. data/ext/ice/cpp/src/Ice/Endpoint.cpp +53 -0
  245. data/ext/ice/cpp/src/Ice/EndpointF.cpp +38 -0
  246. data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +25 -0
  247. data/ext/ice/cpp/src/Ice/EndpointFactory.h +44 -0
  248. data/ext/ice/cpp/src/Ice/EndpointFactoryF.h +26 -0
  249. data/ext/ice/cpp/src/Ice/EndpointFactoryManager.cpp +208 -0
  250. data/ext/ice/cpp/src/Ice/EndpointFactoryManager.h +46 -0
  251. data/ext/ice/cpp/src/Ice/EndpointFactoryManagerF.h +26 -0
  252. data/ext/ice/cpp/src/Ice/EndpointI.cpp +87 -0
  253. data/ext/ice/cpp/src/Ice/EndpointI.h +165 -0
  254. data/ext/ice/cpp/src/Ice/EndpointIF.h +41 -0
  255. data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +38 -0
  256. data/ext/ice/cpp/src/Ice/EventHandler.cpp +35 -0
  257. data/ext/ice/cpp/src/Ice/EventHandler.h +78 -0
  258. data/ext/ice/cpp/src/Ice/EventHandlerF.h +26 -0
  259. data/ext/ice/cpp/src/Ice/EventLoggerMsg.h +53 -0
  260. data/ext/ice/cpp/src/Ice/Exception.cpp +832 -0
  261. data/ext/ice/cpp/src/Ice/FacetMap.cpp +34 -0
  262. data/ext/ice/cpp/src/Ice/FactoryTable.cpp +158 -0
  263. data/ext/ice/cpp/src/Ice/FactoryTableInit.cpp +95 -0
  264. data/ext/ice/cpp/src/Ice/GCObject.cpp +444 -0
  265. data/ext/ice/cpp/src/Ice/HashUtil.h +59 -0
  266. data/ext/ice/cpp/src/Ice/HttpParser.cpp +680 -0
  267. data/ext/ice/cpp/src/Ice/HttpParser.h +124 -0
  268. data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +733 -0
  269. data/ext/ice/cpp/src/Ice/IPEndpointI.h +157 -0
  270. data/ext/ice/cpp/src/Ice/IPEndpointIF.h +29 -0
  271. data/ext/ice/cpp/src/Ice/Identity.cpp +42 -0
  272. data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +41 -0
  273. data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +38 -0
  274. data/ext/ice/cpp/src/Ice/ImplicitContextI.cpp +639 -0
  275. data/ext/ice/cpp/src/Ice/ImplicitContextI.h +51 -0
  276. data/ext/ice/cpp/src/Ice/Incoming.cpp +757 -0
  277. data/ext/ice/cpp/src/Ice/IncomingAsync.cpp +340 -0
  278. data/ext/ice/cpp/src/Ice/IncomingRequest.h +37 -0
  279. data/ext/ice/cpp/src/Ice/Initialize.cpp +401 -0
  280. data/ext/ice/cpp/src/Ice/Instance.cpp +1928 -0
  281. data/ext/ice/cpp/src/Ice/Instance.h +198 -0
  282. data/ext/ice/cpp/src/Ice/Instrumentation.cpp +68 -0
  283. data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +43 -0
  284. data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +1083 -0
  285. data/ext/ice/cpp/src/Ice/InstrumentationI.h +262 -0
  286. data/ext/ice/cpp/src/Ice/LocalException.cpp +2091 -0
  287. data/ext/ice/cpp/src/Ice/LocalObject.cpp +29 -0
  288. data/ext/ice/cpp/src/Ice/Locator.cpp +1946 -0
  289. data/ext/ice/cpp/src/Ice/LocatorF.cpp +39 -0
  290. data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +917 -0
  291. data/ext/ice/cpp/src/Ice/LocatorInfo.h +193 -0
  292. data/ext/ice/cpp/src/Ice/LocatorInfoF.h +34 -0
  293. data/ext/ice/cpp/src/Ice/Logger.cpp +40 -0
  294. data/ext/ice/cpp/src/Ice/LoggerAdminI.cpp +862 -0
  295. data/ext/ice/cpp/src/Ice/LoggerAdminI.h +46 -0
  296. data/ext/ice/cpp/src/Ice/LoggerF.cpp +38 -0
  297. data/ext/ice/cpp/src/Ice/LoggerI.cpp +199 -0
  298. data/ext/ice/cpp/src/Ice/LoggerI.h +57 -0
  299. data/ext/ice/cpp/src/Ice/LoggerUtil.cpp +107 -0
  300. data/ext/ice/cpp/src/Ice/Makefile +190 -0
  301. data/ext/ice/cpp/src/Ice/Metrics.cpp +2159 -0
  302. data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +669 -0
  303. data/ext/ice/cpp/src/Ice/MetricsObserverI.cpp +14 -0
  304. data/ext/ice/cpp/src/Ice/Network.cpp +2694 -0
  305. data/ext/ice/cpp/src/Ice/Network.h +291 -0
  306. data/ext/ice/cpp/src/Ice/NetworkF.h +28 -0
  307. data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +325 -0
  308. data/ext/ice/cpp/src/Ice/NetworkProxy.h +74 -0
  309. data/ext/ice/cpp/src/Ice/NetworkProxyF.h +26 -0
  310. data/ext/ice/cpp/src/Ice/Object.cpp +440 -0
  311. data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +41 -0
  312. data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +38 -0
  313. data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +241 -0
  314. data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.h +52 -0
  315. data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +1498 -0
  316. data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +155 -0
  317. data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +41 -0
  318. data/ext/ice/cpp/src/Ice/ObjectFactoryF.cpp +38 -0
  319. data/ext/ice/cpp/src/Ice/ObjectFactoryManager.cpp +140 -0
  320. data/ext/ice/cpp/src/Ice/ObjectFactoryManager.h +43 -0
  321. data/ext/ice/cpp/src/Ice/ObserverHelper.cpp +84 -0
  322. data/ext/ice/cpp/src/Ice/OpaqueEndpointI.cpp +407 -0
  323. data/ext/ice/cpp/src/Ice/OpaqueEndpointI.h +70 -0
  324. data/ext/ice/cpp/src/Ice/Outgoing.cpp +737 -0
  325. data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +874 -0
  326. data/ext/ice/cpp/src/Ice/Plugin.cpp +43 -0
  327. data/ext/ice/cpp/src/Ice/PluginF.cpp +38 -0
  328. data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +503 -0
  329. data/ext/ice/cpp/src/Ice/PluginManagerI.h +67 -0
  330. data/ext/ice/cpp/src/Ice/Process.cpp +299 -0
  331. data/ext/ice/cpp/src/Ice/ProcessF.cpp +39 -0
  332. data/ext/ice/cpp/src/Ice/Properties.cpp +45 -0
  333. data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +555 -0
  334. data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +207 -0
  335. data/ext/ice/cpp/src/Ice/PropertiesAdminI.h +45 -0
  336. data/ext/ice/cpp/src/Ice/PropertiesF.cpp +39 -0
  337. data/ext/ice/cpp/src/Ice/PropertiesI.cpp +759 -0
  338. data/ext/ice/cpp/src/Ice/PropertiesI.h +78 -0
  339. data/ext/ice/cpp/src/Ice/PropertyNames.cpp +1293 -0
  340. data/ext/ice/cpp/src/Ice/PropertyNames.h +81 -0
  341. data/ext/ice/cpp/src/Ice/Protocol.cpp +137 -0
  342. data/ext/ice/cpp/src/Ice/ProtocolInstance.cpp +98 -0
  343. data/ext/ice/cpp/src/Ice/ProtocolInstance.h +91 -0
  344. data/ext/ice/cpp/src/Ice/ProtocolInstanceF.h +26 -0
  345. data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +51 -0
  346. data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.h +67 -0
  347. data/ext/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +26 -0
  348. data/ext/ice/cpp/src/Ice/Proxy.cpp +1810 -0
  349. data/ext/ice/cpp/src/Ice/ProxyFactory.cpp +305 -0
  350. data/ext/ice/cpp/src/Ice/ProxyFactory.h +57 -0
  351. data/ext/ice/cpp/src/Ice/Reference.cpp +1947 -0
  352. data/ext/ice/cpp/src/Ice/Reference.h +305 -0
  353. data/ext/ice/cpp/src/Ice/ReferenceFactory.cpp +937 -0
  354. data/ext/ice/cpp/src/Ice/ReferenceFactory.h +81 -0
  355. data/ext/ice/cpp/src/Ice/ReferenceFactoryF.h +24 -0
  356. data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +958 -0
  357. data/ext/ice/cpp/src/Ice/ReplyStatus.h +29 -0
  358. data/ext/ice/cpp/src/Ice/RequestHandler.cpp +40 -0
  359. data/ext/ice/cpp/src/Ice/RequestHandler.h +90 -0
  360. data/ext/ice/cpp/src/Ice/RequestHandlerFactory.cpp +70 -0
  361. data/ext/ice/cpp/src/Ice/RequestHandlerFactory.h +41 -0
  362. data/ext/ice/cpp/src/Ice/ResponseHandler.cpp +20 -0
  363. data/ext/ice/cpp/src/Ice/ResponseHandler.h +39 -0
  364. data/ext/ice/cpp/src/Ice/RetryQueue.cpp +154 -0
  365. data/ext/ice/cpp/src/Ice/RetryQueue.h +69 -0
  366. data/ext/ice/cpp/src/Ice/RetryQueueF.h +24 -0
  367. data/ext/ice/cpp/src/Ice/Router.cpp +849 -0
  368. data/ext/ice/cpp/src/Ice/RouterF.cpp +39 -0
  369. data/ext/ice/cpp/src/Ice/RouterInfo.cpp +381 -0
  370. data/ext/ice/cpp/src/Ice/RouterInfo.h +148 -0
  371. data/ext/ice/cpp/src/Ice/RouterInfoF.h +30 -0
  372. data/ext/ice/cpp/src/Ice/Selector.cpp +926 -0
  373. data/ext/ice/cpp/src/Ice/Selector.h +231 -0
  374. data/ext/ice/cpp/src/Ice/ServantLocator.cpp +41 -0
  375. data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +38 -0
  376. data/ext/ice/cpp/src/Ice/ServantManager.cpp +495 -0
  377. data/ext/ice/cpp/src/Ice/ServantManager.h +74 -0
  378. data/ext/ice/cpp/src/Ice/Service.cpp +1897 -0
  379. data/ext/ice/cpp/src/Ice/SharedContext.h +51 -0
  380. data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +34 -0
  381. data/ext/ice/cpp/src/Ice/SliceChecksums.cpp +80 -0
  382. data/ext/ice/cpp/src/Ice/SlicedData.cpp +80 -0
  383. data/ext/ice/cpp/src/Ice/Stream.cpp +53 -0
  384. data/ext/ice/cpp/src/Ice/StreamI.cpp +832 -0
  385. data/ext/ice/cpp/src/Ice/StreamI.h +198 -0
  386. data/ext/ice/cpp/src/Ice/StreamSocket.cpp +521 -0
  387. data/ext/ice/cpp/src/Ice/StreamSocket.h +85 -0
  388. data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +145 -0
  389. data/ext/ice/cpp/src/Ice/SysLoggerI.cpp +167 -0
  390. data/ext/ice/cpp/src/Ice/SysLoggerI.h +43 -0
  391. data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +235 -0
  392. data/ext/ice/cpp/src/Ice/TcpAcceptor.h +67 -0
  393. data/ext/ice/cpp/src/Ice/TcpConnector.cpp +133 -0
  394. data/ext/ice/cpp/src/Ice/TcpConnector.h +51 -0
  395. data/ext/ice/cpp/src/Ice/TcpEndpointI.cpp +397 -0
  396. data/ext/ice/cpp/src/Ice/TcpEndpointI.h +93 -0
  397. data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +127 -0
  398. data/ext/ice/cpp/src/Ice/TcpTransceiver.h +61 -0
  399. data/ext/ice/cpp/src/Ice/ThreadPool.cpp +1357 -0
  400. data/ext/ice/cpp/src/Ice/ThreadPool.h +399 -0
  401. data/ext/ice/cpp/src/Ice/TraceLevels.cpp +43 -0
  402. data/ext/ice/cpp/src/Ice/TraceLevels.h +50 -0
  403. data/ext/ice/cpp/src/Ice/TraceLevelsF.h +26 -0
  404. data/ext/ice/cpp/src/Ice/TraceUtil.cpp +452 -0
  405. data/ext/ice/cpp/src/Ice/TraceUtil.h +28 -0
  406. data/ext/ice/cpp/src/Ice/Transceiver.cpp +24 -0
  407. data/ext/ice/cpp/src/Ice/Transceiver.h +52 -0
  408. data/ext/ice/cpp/src/Ice/TransceiverF.h +38 -0
  409. data/ext/ice/cpp/src/Ice/UdpConnector.cpp +144 -0
  410. data/ext/ice/cpp/src/Ice/UdpConnector.h +51 -0
  411. data/ext/ice/cpp/src/Ice/UdpEndpointI.cpp +483 -0
  412. data/ext/ice/cpp/src/Ice/UdpEndpointI.h +95 -0
  413. data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +1156 -0
  414. data/ext/ice/cpp/src/Ice/UdpTransceiver.h +123 -0
  415. data/ext/ice/cpp/src/Ice/Version.cpp +46 -0
  416. data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +103 -0
  417. data/ext/ice/cpp/src/Ice/WSAcceptor.h +61 -0
  418. data/ext/ice/cpp/src/Ice/WSConnector.cpp +113 -0
  419. data/ext/ice/cpp/src/Ice/WSConnector.h +51 -0
  420. data/ext/ice/cpp/src/Ice/WSEndpoint.cpp +441 -0
  421. data/ext/ice/cpp/src/Ice/WSEndpoint.h +97 -0
  422. data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +1728 -0
  423. data/ext/ice/cpp/src/Ice/WSTransceiver.h +149 -0
  424. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +594 -0
  425. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +1035 -0
  426. data/ext/ice/cpp/src/IceDiscovery/LocatorI.cpp +208 -0
  427. data/ext/ice/cpp/src/IceDiscovery/LocatorI.h +78 -0
  428. data/ext/ice/cpp/src/IceDiscovery/LookupI.cpp +308 -0
  429. data/ext/ice/cpp/src/IceDiscovery/LookupI.h +183 -0
  430. data/ext/ice/cpp/src/IceDiscovery/Makefile +61 -0
  431. data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +148 -0
  432. data/ext/ice/cpp/src/IceDiscovery/PluginI.h +39 -0
  433. data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +258 -0
  434. data/ext/ice/cpp/src/IceSSL/AcceptorI.h +66 -0
  435. data/ext/ice/cpp/src/IceSSL/Certificate.cpp +1334 -0
  436. data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +42 -0
  437. data/ext/ice/cpp/src/IceSSL/ConnectorI.cpp +151 -0
  438. data/ext/ice/cpp/src/IceSSL/ConnectorI.h +56 -0
  439. data/ext/ice/cpp/src/IceSSL/EndpointI.cpp +397 -0
  440. data/ext/ice/cpp/src/IceSSL/EndpointI.h +96 -0
  441. data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +41 -0
  442. data/ext/ice/cpp/src/IceSSL/Instance.cpp +38 -0
  443. data/ext/ice/cpp/src/IceSSL/Instance.h +42 -0
  444. data/ext/ice/cpp/src/IceSSL/InstanceF.h +34 -0
  445. data/ext/ice/cpp/src/IceSSL/Makefile +82 -0
  446. data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +1001 -0
  447. data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +607 -0
  448. data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +75 -0
  449. data/ext/ice/cpp/src/IceSSL/PluginI.cpp +102 -0
  450. data/ext/ice/cpp/src/IceSSL/PluginI.h +56 -0
  451. data/ext/ice/cpp/src/IceSSL/RFC2253.cpp +541 -0
  452. data/ext/ice/cpp/src/IceSSL/RFC2253.h +67 -0
  453. data/ext/ice/cpp/src/IceSSL/SChannelEngine.cpp +729 -0
  454. data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +1062 -0
  455. data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.h +130 -0
  456. data/ext/ice/cpp/src/IceSSL/SSLEngine.cpp +291 -0
  457. data/ext/ice/cpp/src/IceSSL/SSLEngine.h +264 -0
  458. data/ext/ice/cpp/src/IceSSL/SSLEngineF.h +41 -0
  459. data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +1514 -0
  460. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +609 -0
  461. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +91 -0
  462. data/ext/ice/cpp/src/IceSSL/TrustManager.cpp +246 -0
  463. data/ext/ice/cpp/src/IceSSL/TrustManager.h +51 -0
  464. data/ext/ice/cpp/src/IceSSL/TrustManagerF.h +26 -0
  465. data/ext/ice/cpp/src/IceSSL/Util.cpp +1423 -0
  466. data/ext/ice/cpp/src/IceSSL/Util.h +136 -0
  467. data/ext/ice/cpp/src/IceUtil/ArgVector.cpp +65 -0
  468. data/ext/ice/cpp/src/IceUtil/ArgVector.h +41 -0
  469. data/ext/ice/cpp/src/IceUtil/Cond.cpp +386 -0
  470. data/ext/ice/cpp/src/IceUtil/ConvertUTF.cpp +477 -0
  471. data/ext/ice/cpp/src/IceUtil/ConvertUTF.h +144 -0
  472. data/ext/ice/cpp/src/IceUtil/CountDownLatch.cpp +184 -0
  473. data/ext/ice/cpp/src/IceUtil/CtrlCHandler.cpp +273 -0
  474. data/ext/ice/cpp/src/IceUtil/Exception.cpp +782 -0
  475. data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +532 -0
  476. data/ext/ice/cpp/src/IceUtil/FileUtil.h +159 -0
  477. data/ext/ice/cpp/src/IceUtil/InputUtil.cpp +41 -0
  478. data/ext/ice/cpp/src/IceUtil/Makefile +68 -0
  479. data/ext/ice/cpp/src/IceUtil/MutexProtocol.cpp +24 -0
  480. data/ext/ice/cpp/src/IceUtil/Options.cpp +1049 -0
  481. data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +591 -0
  482. data/ext/ice/cpp/src/IceUtil/Random.cpp +185 -0
  483. data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +257 -0
  484. data/ext/ice/cpp/src/IceUtil/SHA1.cpp +126 -0
  485. data/ext/ice/cpp/src/IceUtil/Shared.cpp +200 -0
  486. data/ext/ice/cpp/src/IceUtil/StopWatch.h +54 -0
  487. data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +450 -0
  488. data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +842 -0
  489. data/ext/ice/cpp/src/IceUtil/Thread.cpp +809 -0
  490. data/ext/ice/cpp/src/IceUtil/ThreadException.cpp +172 -0
  491. data/ext/ice/cpp/src/IceUtil/Time.cpp +306 -0
  492. data/ext/ice/cpp/src/IceUtil/Timer.cpp +251 -0
  493. data/ext/ice/cpp/src/IceUtil/UUID.cpp +174 -0
  494. data/ext/ice/cpp/src/IceUtil/Unicode.cpp +131 -0
  495. data/ext/ice/cpp/src/IceUtil/Unicode.h +49 -0
  496. data/ext/ice/cpp/src/Slice/CPlusPlusUtil.cpp +1139 -0
  497. data/ext/ice/cpp/src/Slice/Checksum.cpp +452 -0
  498. data/ext/ice/cpp/src/Slice/CsUtil.cpp +2650 -0
  499. data/ext/ice/cpp/src/Slice/DotNetNames.cpp +146 -0
  500. data/ext/ice/cpp/src/Slice/FileTracker.cpp +203 -0
  501. data/ext/ice/cpp/src/Slice/Grammar.cpp +4755 -0
  502. data/ext/ice/cpp/src/Slice/Grammar.h +98 -0
  503. data/ext/ice/cpp/src/Slice/GrammarUtil.h +234 -0
  504. data/ext/ice/cpp/src/Slice/JavaUtil.cpp +4376 -0
  505. data/ext/ice/cpp/src/Slice/MD5.cpp +57 -0
  506. data/ext/ice/cpp/src/Slice/MD5.h +44 -0
  507. data/ext/ice/cpp/src/Slice/MD5I.cpp +385 -0
  508. data/ext/ice/cpp/src/Slice/MD5I.h +91 -0
  509. data/ext/ice/cpp/src/Slice/Makefile +65 -0
  510. data/ext/ice/cpp/src/Slice/PHPUtil.cpp +156 -0
  511. data/ext/ice/cpp/src/Slice/Parser.cpp +6386 -0
  512. data/ext/ice/cpp/src/Slice/Preprocessor.cpp +686 -0
  513. data/ext/ice/cpp/src/Slice/Python.cpp +675 -0
  514. data/ext/ice/cpp/src/Slice/PythonUtil.cpp +2614 -0
  515. data/ext/ice/cpp/src/Slice/Ruby.cpp +317 -0
  516. data/ext/ice/cpp/src/Slice/RubyUtil.cpp +1774 -0
  517. data/ext/ice/cpp/src/Slice/Scanner.cpp +2426 -0
  518. data/ext/ice/cpp/src/Slice/Util.cpp +325 -0
  519. data/ext/ice/mcpp/config.h.Darwin +227 -0
  520. data/ext/ice/mcpp/config.h.Linux +227 -0
  521. data/ext/ice/mcpp/config.h.MINGW +7 -0
  522. data/ext/ice/mcpp/configed.H +382 -0
  523. data/ext/ice/mcpp/directive.c +1699 -0
  524. data/ext/ice/mcpp/eval.c +1673 -0
  525. data/ext/ice/mcpp/expand.c +2980 -0
  526. data/ext/ice/mcpp/internal.H +564 -0
  527. data/ext/ice/mcpp/main.c +1131 -0
  528. data/ext/ice/mcpp/mbchar.c +869 -0
  529. data/ext/ice/mcpp/mcpp_lib.h +31 -0
  530. data/ext/ice/mcpp/mcpp_out.h +13 -0
  531. data/ext/ice/mcpp/support.c +2811 -0
  532. data/ext/ice/mcpp/system.H +396 -0
  533. data/ext/ice/mcpp/system.c +4940 -0
  534. data/ice.gemspec +41 -0
  535. data/lib/Glacier2.rb +12 -0
  536. data/lib/Glacier2/Metrics.rb +99 -0
  537. data/lib/Glacier2/PermissionsVerifier.rb +168 -0
  538. data/lib/Glacier2/PermissionsVerifierF.rb +34 -0
  539. data/lib/Glacier2/Router.rb +141 -0
  540. data/lib/Glacier2/RouterF.rb +29 -0
  541. data/lib/Glacier2/SSLInfo.rb +79 -0
  542. data/lib/Glacier2/Session.rb +470 -0
  543. data/lib/Ice.rb +659 -0
  544. data/lib/Ice/BuiltinSequences.rb +64 -0
  545. data/lib/Ice/Communicator.rb +93 -0
  546. data/lib/Ice/CommunicatorF.rb +28 -0
  547. data/lib/Ice/Connection.rb +414 -0
  548. data/lib/Ice/ConnectionF.rb +36 -0
  549. data/lib/Ice/Current.rb +152 -0
  550. data/lib/Ice/Endpoint.rb +265 -0
  551. data/lib/Ice/EndpointF.rb +52 -0
  552. data/lib/Ice/EndpointTypes.rb +77 -0
  553. data/lib/Ice/FacetMap.rb +28 -0
  554. data/lib/Ice/Identity.rb +70 -0
  555. data/lib/Ice/ImplicitContext.rb +59 -0
  556. data/lib/Ice/ImplicitContextF.rb +28 -0
  557. data/lib/Ice/Instrumentation.rb +425 -0
  558. data/lib/Ice/InstrumentationF.rb +35 -0
  559. data/lib/Ice/LocalException.rb +1081 -0
  560. data/lib/Ice/Locator.rb +314 -0
  561. data/lib/Ice/LocatorF.rb +34 -0
  562. data/lib/Ice/Logger.rb +57 -0
  563. data/lib/Ice/LoggerF.rb +28 -0
  564. data/lib/Ice/Metrics.rb +696 -0
  565. data/lib/Ice/ObjectAdapterF.rb +28 -0
  566. data/lib/Ice/ObjectFactory.rb +53 -0
  567. data/lib/Ice/ObjectFactoryF.rb +28 -0
  568. data/lib/Ice/Plugin.rb +87 -0
  569. data/lib/Ice/PluginF.rb +32 -0
  570. data/lib/Ice/Process.rb +93 -0
  571. data/lib/Ice/ProcessF.rb +29 -0
  572. data/lib/Ice/Properties.rb +65 -0
  573. data/lib/Ice/PropertiesAdmin.rb +104 -0
  574. data/lib/Ice/PropertiesF.rb +33 -0
  575. data/lib/Ice/Router.rb +163 -0
  576. data/lib/Ice/RouterF.rb +29 -0
  577. data/lib/Ice/SliceChecksumDict.rb +28 -0
  578. data/lib/Ice/Version.rb +100 -0
  579. data/lib/IceBox.rb +10 -0
  580. data/lib/IceBox/IceBox.rb +272 -0
  581. data/lib/IceGrid.rb +17 -0
  582. data/lib/IceGrid/Admin.rb +1076 -0
  583. data/lib/IceGrid/Descriptor.rb +1505 -0
  584. data/lib/IceGrid/Exception.rb +401 -0
  585. data/lib/IceGrid/FileParser.rb +105 -0
  586. data/lib/IceGrid/Locator.rb +105 -0
  587. data/lib/IceGrid/Observer.rb +571 -0
  588. data/lib/IceGrid/Query.rb +168 -0
  589. data/lib/IceGrid/Registry.rb +120 -0
  590. data/lib/IceGrid/Session.rb +114 -0
  591. data/lib/IceGrid/UserAccountMapper.rb +101 -0
  592. data/lib/IcePatch2.rb +10 -0
  593. data/lib/IcePatch2/FileInfo.rb +75 -0
  594. data/lib/IcePatch2/FileServer.rb +141 -0
  595. data/lib/IceStorm.rb +11 -0
  596. data/lib/IceStorm/IceStorm.rb +463 -0
  597. data/lib/IceStorm/Metrics.rb +155 -0
  598. data/slice/Freeze/BackgroundSaveEvictor.ice +111 -0
  599. data/slice/Freeze/CatalogData.ice +49 -0
  600. data/slice/Freeze/Connection.ice +111 -0
  601. data/slice/Freeze/ConnectionF.ice +20 -0
  602. data/slice/Freeze/DB.ice +37 -0
  603. data/slice/Freeze/Evictor.ice +339 -0
  604. data/slice/Freeze/EvictorF.ice +22 -0
  605. data/slice/Freeze/EvictorStorage.ice +72 -0
  606. data/slice/Freeze/Exception.ice +100 -0
  607. data/slice/Freeze/Transaction.ice +57 -0
  608. data/slice/Freeze/TransactionalEvictor.ice +50 -0
  609. data/slice/Glacier2/Metrics.ice +77 -0
  610. data/slice/Glacier2/PermissionsVerifier.ice +105 -0
  611. data/slice/Glacier2/PermissionsVerifierF.ice +21 -0
  612. data/slice/Glacier2/Router.ice +178 -0
  613. data/slice/Glacier2/RouterF.ice +20 -0
  614. data/slice/Glacier2/SSLInfo.ice +50 -0
  615. data/slice/Glacier2/Session.ice +273 -0
  616. data/slice/Ice/BuiltinSequences.ice +48 -0
  617. data/slice/Ice/Communicator.ice +567 -0
  618. data/slice/Ice/CommunicatorF.ice +20 -0
  619. data/slice/Ice/Connection.ice +323 -0
  620. data/slice/Ice/ConnectionF.ice +22 -0
  621. data/slice/Ice/Current.ice +160 -0
  622. data/slice/Ice/Endpoint.ice +227 -0
  623. data/slice/Ice/EndpointF.ice +32 -0
  624. data/slice/Ice/EndpointTypes.ice +38 -0
  625. data/slice/Ice/FacetMap.ice +25 -0
  626. data/slice/Ice/Identity.ice +59 -0
  627. data/slice/Ice/ImplicitContext.ice +109 -0
  628. data/slice/Ice/ImplicitContextF.ice +20 -0
  629. data/slice/Ice/Instrumentation.ice +499 -0
  630. data/slice/Ice/InstrumentationF.ice +26 -0
  631. data/slice/Ice/LocalException.ice +1015 -0
  632. data/slice/Ice/Locator.ice +227 -0
  633. data/slice/Ice/LocatorF.ice +21 -0
  634. data/slice/Ice/Logger.ice +86 -0
  635. data/slice/Ice/LoggerF.ice +20 -0
  636. data/slice/Ice/Metrics.ice +422 -0
  637. data/slice/Ice/ObjectAdapter.ice +673 -0
  638. data/slice/Ice/ObjectAdapterF.ice +20 -0
  639. data/slice/Ice/ObjectFactory.ice +60 -0
  640. data/slice/Ice/ObjectFactoryF.ice +20 -0
  641. data/slice/Ice/Plugin.ice +117 -0
  642. data/slice/Ice/PluginF.ice +21 -0
  643. data/slice/Ice/Process.ice +54 -0
  644. data/slice/Ice/ProcessF.ice +20 -0
  645. data/slice/Ice/Properties.ice +228 -0
  646. data/slice/Ice/PropertiesAdmin.ice +75 -0
  647. data/slice/Ice/PropertiesF.ice +21 -0
  648. data/slice/Ice/RemoteLogger.ice +232 -0
  649. data/slice/Ice/Router.ice +83 -0
  650. data/slice/Ice/RouterF.ice +20 -0
  651. data/slice/Ice/ServantLocator.ice +117 -0
  652. data/slice/Ice/ServantLocatorF.ice +20 -0
  653. data/slice/Ice/SliceChecksumDict.ice +25 -0
  654. data/slice/Ice/Version.ice +39 -0
  655. data/slice/IceBox/IceBox.ice +194 -0
  656. data/slice/IceDiscovery/IceDiscovery.ice +32 -0
  657. data/slice/IceGrid/Admin.ice +1578 -0
  658. data/slice/IceGrid/Descriptor.ice +1079 -0
  659. data/slice/IceGrid/Discovery.ice +73 -0
  660. data/slice/IceGrid/Exception.ice +383 -0
  661. data/slice/IceGrid/FileParser.ice +61 -0
  662. data/slice/IceGrid/Locator.ice +56 -0
  663. data/slice/IceGrid/Observer.ice +394 -0
  664. data/slice/IceGrid/PluginFacade.ice +316 -0
  665. data/slice/IceGrid/Query.ice +130 -0
  666. data/slice/IceGrid/Registry.ice +138 -0
  667. data/slice/IceGrid/Session.ice +124 -0
  668. data/slice/IceGrid/UserAccountMapper.ice +58 -0
  669. data/slice/IcePatch2/FileInfo.ice +49 -0
  670. data/slice/IcePatch2/FileServer.ice +129 -0
  671. data/slice/IceSSL/ConnectionInfo.ice +34 -0
  672. data/slice/IceSSL/EndpointInfo.ice +41 -0
  673. data/slice/IceStorm/IceStorm.ice +405 -0
  674. data/slice/IceStorm/Metrics.ice +71 -0
  675. metadata +737 -0
@@ -0,0 +1,97 @@
1
+ // **********************************************************************
2
+ //
3
+ // Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
4
+ //
5
+ // This copy of Ice is licensed to you under the terms described in the
6
+ // ICE_LICENSE file included in this distribution.
7
+ //
8
+ // **********************************************************************
9
+
10
+ #ifndef ICE_CONNECT_REQUEST_HANDLER_H
11
+ #define ICE_CONNECT_REQUEST_HANDLER_H
12
+
13
+ #include <IceUtil/Monitor.h>
14
+ #include <IceUtil/Mutex.h>
15
+
16
+ #include <Ice/RequestHandler.h>
17
+ #include <Ice/Reference.h>
18
+ #include <Ice/RouterInfo.h>
19
+ #include <Ice/ProxyF.h>
20
+ #include <Ice/BasicStream.h>
21
+
22
+ #include <IceUtil/UniquePtr.h>
23
+
24
+ #include <deque>
25
+ #include <set>
26
+
27
+ namespace IceInternal
28
+ {
29
+
30
+ class ConnectRequestHandler : public RequestHandler,
31
+ public Reference::GetConnectionCallback,
32
+ public RouterInfo::AddProxyCallback,
33
+ public IceUtil::Monitor<IceUtil::Mutex>
34
+ {
35
+ public:
36
+
37
+ ConnectRequestHandler(const ReferencePtr&, const Ice::ObjectPrx&);
38
+ virtual ~ConnectRequestHandler();
39
+
40
+ virtual RequestHandlerPtr connect(const Ice::ObjectPrx&);
41
+ virtual RequestHandlerPtr update(const RequestHandlerPtr&, const RequestHandlerPtr&);
42
+
43
+ virtual void prepareBatchRequest(BasicStream*);
44
+ virtual void finishBatchRequest(BasicStream*);
45
+ virtual void abortBatchRequest();
46
+
47
+ virtual bool sendRequest(OutgoingBase*);
48
+ virtual AsyncStatus sendAsyncRequest(const OutgoingAsyncBasePtr&);
49
+
50
+ virtual void requestCanceled(OutgoingBase*, const Ice::LocalException&);
51
+ virtual void asyncRequestCanceled(const OutgoingAsyncBasePtr&, const Ice::LocalException&);
52
+
53
+ virtual Ice::ConnectionIPtr getConnection();
54
+ virtual Ice::ConnectionIPtr waitForConnection();
55
+
56
+ virtual void setConnection(const Ice::ConnectionIPtr&, bool);
57
+ virtual void setException(const Ice::LocalException&);
58
+
59
+ virtual void addedProxy();
60
+
61
+ private:
62
+
63
+ bool initialized();
64
+ void flushRequests();
65
+
66
+ struct Request
67
+ {
68
+ Request() : out(0), os(0)
69
+ {
70
+ }
71
+
72
+ OutgoingBase* out;
73
+ OutgoingAsyncBasePtr outAsync;
74
+ BasicStream* os;
75
+ };
76
+
77
+ bool _connect;
78
+ Ice::ObjectPrx _proxy;
79
+ std::set<Ice::ObjectPrx> _proxies;
80
+
81
+ Ice::ConnectionIPtr _connection;
82
+ bool _compress;
83
+ IceUtil::UniquePtr<Ice::LocalException> _exception;
84
+ bool _initialized;
85
+ bool _flushing;
86
+
87
+ std::deque<Request> _requests;
88
+ bool _batchRequestInProgress;
89
+ BasicStream _batchStream;
90
+
91
+ RequestHandlerPtr _connectionRequestHandler;
92
+ };
93
+ typedef IceUtil::Handle<ConnectRequestHandler> ConnectRequestHandlerPtr;
94
+
95
+ }
96
+
97
+ #endif
@@ -0,0 +1,58 @@
1
+ // **********************************************************************
2
+ //
3
+ // Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
4
+ //
5
+ // This copy of Ice is licensed to you under the terms described in the
6
+ // ICE_LICENSE file included in this distribution.
7
+ //
8
+ // **********************************************************************
9
+ //
10
+ // Ice version 3.6b
11
+ //
12
+ // <auto-generated>
13
+ //
14
+ // Generated from file `Connection.ice'
15
+ //
16
+ // Warning: do not edit this file.
17
+ //
18
+ // </auto-generated>
19
+ //
20
+
21
+ #ifndef ICE_API_EXPORTS
22
+ # define ICE_API_EXPORTS
23
+ #endif
24
+ #include <Ice/Connection.h>
25
+ #include <IceUtil/PushDisableWarnings.h>
26
+ #include <Ice/OutgoingAsync.h>
27
+ #include <Ice/BasicStream.h>
28
+ #include <IceUtil/Iterator.h>
29
+ #include <IceUtil/PopDisableWarnings.h>
30
+
31
+ #ifndef ICE_IGNORE_VERSION
32
+ # if ICE_INT_VERSION != 30651
33
+ # error Ice version mismatch: an exact match is required for beta generated code
34
+ # endif
35
+ #endif
36
+
37
+ namespace
38
+ {
39
+
40
+ }
41
+
42
+ namespace Ice
43
+ {
44
+ }
45
+
46
+ ICE_DECLSPEC_EXPORT ::Ice::LocalObject* Ice::upCast(::Ice::ConnectionInfo* p) { return p; }
47
+
48
+ ICE_DECLSPEC_EXPORT ::Ice::LocalObject* Ice::upCast(::Ice::ConnectionCallback* p) { return p; }
49
+
50
+ ICE_DECLSPEC_EXPORT ::Ice::LocalObject* Ice::upCast(::Ice::Connection* p) { return p; }
51
+
52
+ ICE_DECLSPEC_EXPORT ::Ice::LocalObject* Ice::upCast(::Ice::IPConnectionInfo* p) { return p; }
53
+
54
+ ICE_DECLSPEC_EXPORT ::Ice::LocalObject* Ice::upCast(::Ice::TCPConnectionInfo* p) { return p; }
55
+
56
+ ICE_DECLSPEC_EXPORT ::Ice::LocalObject* Ice::upCast(::Ice::UDPConnectionInfo* p) { return p; }
57
+
58
+ ICE_DECLSPEC_EXPORT ::Ice::LocalObject* Ice::upCast(::Ice::WSConnectionInfo* p) { return p; }
@@ -0,0 +1,38 @@
1
+ // **********************************************************************
2
+ //
3
+ // Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
4
+ //
5
+ // This copy of Ice is licensed to you under the terms described in the
6
+ // ICE_LICENSE file included in this distribution.
7
+ //
8
+ // **********************************************************************
9
+ //
10
+ // Ice version 3.6b
11
+ //
12
+ // <auto-generated>
13
+ //
14
+ // Generated from file `ConnectionF.ice'
15
+ //
16
+ // Warning: do not edit this file.
17
+ //
18
+ // </auto-generated>
19
+ //
20
+
21
+ #ifndef ICE_API_EXPORTS
22
+ # define ICE_API_EXPORTS
23
+ #endif
24
+ #include <Ice/ConnectionF.h>
25
+ #include <IceUtil/PushDisableWarnings.h>
26
+ #include <IceUtil/Iterator.h>
27
+ #include <IceUtil/PopDisableWarnings.h>
28
+
29
+ #ifndef ICE_IGNORE_VERSION
30
+ # if ICE_INT_VERSION != 30651
31
+ # error Ice version mismatch: an exact match is required for beta generated code
32
+ # endif
33
+ #endif
34
+
35
+ namespace
36
+ {
37
+
38
+ }
@@ -0,0 +1,1639 @@
1
+ // **********************************************************************
2
+ //
3
+ // Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
4
+ //
5
+ // This copy of Ice is licensed to you under the terms described in the
6
+ // ICE_LICENSE file included in this distribution.
7
+ //
8
+ // **********************************************************************
9
+
10
+ #include <Ice/ConnectionFactory.h>
11
+ #include <Ice/ConnectionI.h>
12
+ #include <Ice/Instance.h>
13
+ #include <Ice/LoggerUtil.h>
14
+ #include <Ice/TraceLevels.h>
15
+ #include <Ice/DefaultsAndOverrides.h>
16
+ #include <Ice/Properties.h>
17
+ #include <Ice/Transceiver.h>
18
+ #include <Ice/Connector.h>
19
+ #include <Ice/Acceptor.h>
20
+ #include <Ice/ThreadPool.h>
21
+ #include <Ice/ObjectAdapterI.h> // For getThreadPool().
22
+ #include <Ice/Reference.h>
23
+ #include <Ice/EndpointI.h>
24
+ #include <Ice/RouterInfo.h>
25
+ #include <Ice/LocalException.h>
26
+ #include <Ice/Functional.h>
27
+ #include <Ice/OutgoingAsync.h>
28
+ #include <IceUtil/Random.h>
29
+ #include <iterator>
30
+
31
+ using namespace std;
32
+ using namespace Ice;
33
+ using namespace Ice::Instrumentation;
34
+ using namespace IceInternal;
35
+
36
+ IceUtil::Shared* IceInternal::upCast(OutgoingConnectionFactory* p) { return p; }
37
+ IceUtil::Shared* IceInternal::upCast(IncomingConnectionFactory* p) { return p; }
38
+
39
+ namespace
40
+ {
41
+
42
+ struct RandomNumberGenerator : public std::unary_function<ptrdiff_t, ptrdiff_t>
43
+ {
44
+ ptrdiff_t operator()(ptrdiff_t d)
45
+ {
46
+ return IceUtilInternal::random(static_cast<int>(d));
47
+ }
48
+ };
49
+
50
+ template <typename K, typename V> void
51
+ remove(multimap<K, V>& m, K k, V v)
52
+ {
53
+ pair<typename multimap<K, V>::iterator, typename multimap<K, V>::iterator> pr = m.equal_range(k);
54
+ assert(pr.first != pr.second);
55
+ for(typename multimap<K, V>::iterator q = pr.first; q != pr.second; ++q)
56
+ {
57
+ if(q->second.get() == v.get())
58
+ {
59
+ m.erase(q);
60
+ return;
61
+ }
62
+ }
63
+ assert(false); // Nothing was removed which is an error.
64
+ }
65
+
66
+ template <typename K, typename V> ::IceInternal::Handle<V>
67
+ find(const multimap<K,::IceInternal::Handle<V> >& m,
68
+ K k,
69
+ const ::IceUtilInternal::ConstMemFun<bool, V, ::IceInternal::Handle<V> >& predicate)
70
+ {
71
+ pair<typename multimap<K, ::IceInternal::Handle<V> >::const_iterator,
72
+ typename multimap<K, ::IceInternal::Handle<V> >::const_iterator> pr = m.equal_range(k);
73
+ for(typename multimap<K, ::IceInternal::Handle<V> >::const_iterator q = pr.first; q != pr.second; ++q)
74
+ {
75
+ if(predicate(q->second))
76
+ {
77
+ return q->second;
78
+ }
79
+ }
80
+ return IceInternal::Handle<V>();
81
+ }
82
+
83
+ }
84
+
85
+ bool
86
+ IceInternal::OutgoingConnectionFactory::ConnectorInfo::operator==(const ConnectorInfo& other) const
87
+ {
88
+ return connector == other.connector;
89
+ }
90
+
91
+ void
92
+ IceInternal::OutgoingConnectionFactory::destroy()
93
+ {
94
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
95
+
96
+ if(_destroyed)
97
+ {
98
+ return;
99
+ }
100
+
101
+ for_each(_connections.begin(), _connections.end(),
102
+ bind2nd(Ice::secondVoidMemFun1<const ConnectorPtr, ConnectionI, ConnectionI::DestructionReason>
103
+ (&ConnectionI::destroy), ConnectionI::CommunicatorDestroyed));
104
+
105
+ _destroyed = true;
106
+ _communicator = 0;
107
+
108
+ notifyAll();
109
+ }
110
+
111
+ void
112
+ IceInternal::OutgoingConnectionFactory::updateConnectionObservers()
113
+ {
114
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
115
+ for_each(_connections.begin(), _connections.end(),
116
+ Ice::secondVoidMemFun<const ConnectorPtr, ConnectionI>(&ConnectionI::updateObserver));
117
+ }
118
+
119
+ void
120
+ IceInternal::OutgoingConnectionFactory::waitUntilFinished()
121
+ {
122
+ multimap<ConnectorPtr, ConnectionIPtr> connections;
123
+
124
+ {
125
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
126
+
127
+ //
128
+ // First we wait until the factory is destroyed. We also wait
129
+ // until there are no pending connections anymore. Only then
130
+ // we can be sure the _connections contains all connections.
131
+ //
132
+ while(!_destroyed || !_pending.empty() || _pendingConnectCount > 0)
133
+ {
134
+ wait();
135
+ }
136
+
137
+ //
138
+ // We want to wait until all connections are finished outside the
139
+ // thread synchronization.
140
+ //
141
+ connections = _connections;
142
+ }
143
+
144
+ for_each(connections.begin(), connections.end(),
145
+ Ice::secondVoidMemFun<const ConnectorPtr, ConnectionI>(&ConnectionI::waitUntilFinished));
146
+
147
+ {
148
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
149
+ // Ensure all the connections are finished and reapable at this point.
150
+ vector<Ice::ConnectionIPtr> cons;
151
+ _monitor->swapReapedConnections(cons);
152
+ assert(cons.size() == _connections.size());
153
+ cons.clear();
154
+ _connections.clear();
155
+ _connectionsByEndpoint.clear();
156
+ _monitor->destroy();
157
+ }
158
+ }
159
+
160
+ void
161
+ IceInternal::OutgoingConnectionFactory::create(const vector<EndpointIPtr>& endpts, bool hasMore,
162
+ Ice::EndpointSelectionType selType,
163
+ const CreateConnectionCallbackPtr& callback)
164
+ {
165
+ assert(!endpts.empty());
166
+
167
+ //
168
+ // Apply the overrides.
169
+ //
170
+ vector<EndpointIPtr> endpoints = applyOverrides(endpts);
171
+
172
+ //
173
+ // Try to find a connection to one of the given endpoints.
174
+ //
175
+ try
176
+ {
177
+ bool compress;
178
+ Ice::ConnectionIPtr connection = findConnection(endpoints, compress);
179
+ if(connection)
180
+ {
181
+ callback->setConnection(connection, compress);
182
+ return;
183
+ }
184
+ }
185
+ catch(const Ice::LocalException& ex)
186
+ {
187
+ callback->setException(ex);
188
+ return;
189
+ }
190
+
191
+ ConnectCallbackPtr cb = new ConnectCallback(_instance, this, endpoints, hasMore, callback, selType);
192
+ cb->getConnectors();
193
+ }
194
+
195
+ void
196
+ IceInternal::OutgoingConnectionFactory::setRouterInfo(const RouterInfoPtr& routerInfo)
197
+ {
198
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
199
+
200
+ if(_destroyed)
201
+ {
202
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
203
+ }
204
+
205
+ assert(routerInfo);
206
+
207
+ //
208
+ // Search for connections to the router's client proxy endpoints,
209
+ // and update the object adapter for such connections, so that
210
+ // callbacks from the router can be received over such
211
+ // connections.
212
+ //
213
+ ObjectAdapterPtr adapter = routerInfo->getAdapter();
214
+ vector<EndpointIPtr> endpoints = routerInfo->getClientEndpoints();
215
+ for(vector<EndpointIPtr>::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p)
216
+ {
217
+ EndpointIPtr endpoint = *p;
218
+
219
+ //
220
+ // Modify endpoints with overrides.
221
+ //
222
+ if(_instance->defaultsAndOverrides()->overrideTimeout)
223
+ {
224
+ endpoint = endpoint->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue);
225
+ }
226
+
227
+ //
228
+ // The Connection object does not take the compression flag of
229
+ // endpoints into account, but instead gets the information
230
+ // about whether messages should be compressed or not from
231
+ // other sources. In order to allow connection sharing for
232
+ // endpoints that differ in the value of the compression flag
233
+ // only, we always set the compression flag to false here in
234
+ // this connection factory.
235
+ //
236
+ endpoint = endpoint->compress(false);
237
+
238
+ for(multimap<ConnectorPtr, ConnectionIPtr>::const_iterator q = _connections.begin();
239
+ q != _connections.end(); ++q)
240
+ {
241
+ if(q->second->endpoint() == endpoint)
242
+ {
243
+ q->second->setAdapter(adapter);
244
+ }
245
+ }
246
+ }
247
+ }
248
+
249
+ void
250
+ IceInternal::OutgoingConnectionFactory::removeAdapter(const ObjectAdapterPtr& adapter)
251
+ {
252
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
253
+
254
+ if(_destroyed)
255
+ {
256
+ return;
257
+ }
258
+
259
+ for(multimap<ConnectorPtr, ConnectionIPtr>::const_iterator p = _connections.begin(); p != _connections.end(); ++p)
260
+ {
261
+ if(p->second->getAdapter() == adapter)
262
+ {
263
+ p->second->setAdapter(0);
264
+ }
265
+ }
266
+ }
267
+
268
+ void
269
+ IceInternal::OutgoingConnectionFactory::flushAsyncBatchRequests(const CommunicatorFlushBatchPtr& outAsync)
270
+ {
271
+ list<ConnectionIPtr> c;
272
+
273
+ {
274
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
275
+ for(multimap<ConnectorPtr, ConnectionIPtr>::const_iterator p = _connections.begin(); p != _connections.end();
276
+ ++p)
277
+ {
278
+ if(p->second->isActiveOrHolding())
279
+ {
280
+ c.push_back(p->second);
281
+ }
282
+ }
283
+ }
284
+
285
+ for(list<ConnectionIPtr>::const_iterator p = c.begin(); p != c.end(); ++p)
286
+ {
287
+ try
288
+ {
289
+ outAsync->flushConnection(*p);
290
+ }
291
+ catch(const LocalException&)
292
+ {
293
+ // Ignore.
294
+ }
295
+ }
296
+ }
297
+
298
+ IceInternal::OutgoingConnectionFactory::OutgoingConnectionFactory(const CommunicatorPtr& communicator,
299
+ const InstancePtr& instance) :
300
+ _communicator(communicator),
301
+ _instance(instance),
302
+ _monitor(new FactoryACMMonitor(instance, instance->clientACM())),
303
+ _destroyed(false),
304
+ _pendingConnectCount(0)
305
+ {
306
+ }
307
+
308
+ IceInternal::OutgoingConnectionFactory::~OutgoingConnectionFactory()
309
+ {
310
+ assert(_destroyed);
311
+ assert(_connections.empty());
312
+ assert(_connectionsByEndpoint.empty());
313
+ assert(_pending.empty());
314
+ assert(_pendingConnectCount == 0);
315
+ }
316
+
317
+ vector<EndpointIPtr>
318
+ IceInternal::OutgoingConnectionFactory::applyOverrides(const vector<EndpointIPtr>& endpts)
319
+ {
320
+ DefaultsAndOverridesPtr defaultsAndOverrides = _instance->defaultsAndOverrides();
321
+ vector<EndpointIPtr> endpoints = endpts;
322
+ for(vector<EndpointIPtr>::iterator p = endpoints.begin(); p != endpoints.end(); ++p)
323
+ {
324
+ //
325
+ // Modify endpoints with overrides.
326
+ //
327
+ if(defaultsAndOverrides->overrideTimeout)
328
+ {
329
+ *p = (*p)->timeout(defaultsAndOverrides->overrideTimeoutValue);
330
+ }
331
+ }
332
+ return endpoints;
333
+ }
334
+
335
+ ConnectionIPtr
336
+ IceInternal::OutgoingConnectionFactory::findConnection(const vector<EndpointIPtr>& endpoints, bool& compress)
337
+ {
338
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
339
+ if(_destroyed)
340
+ {
341
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
342
+ }
343
+
344
+ DefaultsAndOverridesPtr defaultsAndOverrides = _instance->defaultsAndOverrides();
345
+ assert(!endpoints.empty());
346
+ for(vector<EndpointIPtr>::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p)
347
+ {
348
+ ConnectionIPtr connection = find(_connectionsByEndpoint, *p, Ice::constMemFun(&ConnectionI::isActiveOrHolding));
349
+ if(connection)
350
+ {
351
+ if(defaultsAndOverrides->overrideCompress)
352
+ {
353
+ compress = defaultsAndOverrides->overrideCompressValue;
354
+ }
355
+ else
356
+ {
357
+ compress = (*p)->compress();
358
+ }
359
+ return connection;
360
+ }
361
+ }
362
+ return 0;
363
+ }
364
+
365
+ ConnectionIPtr
366
+ IceInternal::OutgoingConnectionFactory::findConnection(const vector<ConnectorInfo>& connectors, bool& compress)
367
+ {
368
+ // This must be called with the mutex locked.
369
+
370
+ DefaultsAndOverridesPtr defaultsAndOverrides = _instance->defaultsAndOverrides();
371
+ for(vector<ConnectorInfo>::const_iterator p = connectors.begin(); p != connectors.end(); ++p)
372
+ {
373
+ if(_pending.find(p->connector) != _pending.end())
374
+ {
375
+ continue;
376
+ }
377
+
378
+ ConnectionIPtr connection = find(_connections, p->connector, Ice::constMemFun(&ConnectionI::isActiveOrHolding));
379
+ if(connection)
380
+ {
381
+ if(defaultsAndOverrides->overrideCompress)
382
+ {
383
+ compress = defaultsAndOverrides->overrideCompressValue;
384
+ }
385
+ else
386
+ {
387
+ compress = p->endpoint->compress();
388
+ }
389
+ return connection;
390
+ }
391
+ }
392
+
393
+ return 0;
394
+ }
395
+
396
+ void
397
+ IceInternal::OutgoingConnectionFactory::incPendingConnectCount()
398
+ {
399
+ //
400
+ // Keep track of the number of pending connects. The outgoing connection factory
401
+ // waitUntilFinished() method waits for all the pending connects to terminate before
402
+ // to return. This ensures that the communicator client thread pool isn't destroyed
403
+ // too soon and will still be available to execute the ice_exception() callbacks for
404
+ // the asynchronous requests waiting on a connection to be established.
405
+ //
406
+
407
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
408
+ if(_destroyed)
409
+ {
410
+ throw Ice::CommunicatorDestroyedException(__FILE__, __LINE__);
411
+ }
412
+ ++_pendingConnectCount;
413
+ }
414
+
415
+ void
416
+ IceInternal::OutgoingConnectionFactory::decPendingConnectCount()
417
+ {
418
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
419
+ --_pendingConnectCount;
420
+ assert(_pendingConnectCount >= 0);
421
+ if(_destroyed && _pendingConnectCount == 0)
422
+ {
423
+ notifyAll();
424
+ }
425
+ }
426
+
427
+ ConnectionIPtr
428
+ IceInternal::OutgoingConnectionFactory::getConnection(const vector<ConnectorInfo>& connectors,
429
+ const ConnectCallbackPtr& cb,
430
+ bool& compress)
431
+ {
432
+ {
433
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
434
+ if(_destroyed)
435
+ {
436
+ throw Ice::CommunicatorDestroyedException(__FILE__, __LINE__);
437
+ }
438
+
439
+ //
440
+ // Reap closed connections
441
+ //
442
+ vector<Ice::ConnectionIPtr> cons;
443
+ _monitor->swapReapedConnections(cons);
444
+ for(vector<Ice::ConnectionIPtr>::const_iterator p = cons.begin(); p != cons.end(); ++p)
445
+ {
446
+ remove(_connections, (*p)->connector(), *p);
447
+ remove(_connectionsByEndpoint, (*p)->endpoint(), *p);
448
+ remove(_connectionsByEndpoint, (*p)->endpoint()->compress(true), *p);
449
+ }
450
+
451
+ //
452
+ // Try to get the connection. We may need to wait for other threads to
453
+ // finish if one of them is currently establishing a connection to one
454
+ // of our connectors.
455
+ //
456
+ while(true)
457
+ {
458
+ if(_destroyed)
459
+ {
460
+ throw Ice::CommunicatorDestroyedException(__FILE__, __LINE__);
461
+ }
462
+
463
+ //
464
+ // Search for a matching connection. If we find one, we're done.
465
+ //
466
+ Ice::ConnectionIPtr connection = findConnection(connectors, compress);
467
+ if(connection)
468
+ {
469
+ return connection;
470
+ }
471
+
472
+ //
473
+ // Determine whether another thread/request is currently attempting to connect to
474
+ // one of our endpoints; if so we wait until it's done.
475
+ //
476
+ if(addToPending(cb, connectors))
477
+ {
478
+ //
479
+ // If a callback is not specified we wait until another thread notifies us about a
480
+ // change to the pending list. Otherwise, if a callback is provided we're done:
481
+ // when the pending list changes the callback will be notified and will try to
482
+ // get the connection again.
483
+ //
484
+ if(!cb)
485
+ {
486
+ wait();
487
+ }
488
+ else
489
+ {
490
+ return 0;
491
+ }
492
+ }
493
+ else
494
+ {
495
+ //
496
+ // If no thread is currently establishing a connection to one of our connectors,
497
+ // we get out of this loop and start the connection establishment to one of the
498
+ // given connectors.
499
+ //
500
+ break;
501
+ }
502
+ }
503
+ }
504
+
505
+ //
506
+ // At this point, we're responsible for establishing the connection to one of
507
+ // the given connectors. If it's a non-blocking connect, calling nextConnector
508
+ // will start the connection establishment. Otherwise, we return null to get
509
+ // the caller to establish the connection.
510
+ //
511
+ if(cb)
512
+ {
513
+ cb->nextConnector();
514
+ }
515
+
516
+ return 0;
517
+ }
518
+
519
+ ConnectionIPtr
520
+ IceInternal::OutgoingConnectionFactory::createConnection(const TransceiverPtr& transceiver, const ConnectorInfo& ci)
521
+ {
522
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
523
+ assert(_pending.find(ci.connector) != _pending.end() && transceiver);
524
+
525
+ //
526
+ // Create and add the connection to the connection map. Adding the connection to the map
527
+ // is necessary to support the interruption of the connection initialization and validation
528
+ // in case the communicator is destroyed.
529
+ //
530
+ Ice::ConnectionIPtr connection;
531
+ try
532
+ {
533
+ if(_destroyed)
534
+ {
535
+ throw Ice::CommunicatorDestroyedException(__FILE__, __LINE__);
536
+ }
537
+
538
+ connection = new ConnectionI(_communicator, _instance, _monitor, transceiver, ci.connector,
539
+ ci.endpoint->compress(false), 0);
540
+ }
541
+ catch(const Ice::LocalException&)
542
+ {
543
+ try
544
+ {
545
+ transceiver->close();
546
+ }
547
+ catch(const Ice::LocalException&)
548
+ {
549
+ // Ignore
550
+ }
551
+ throw;
552
+ }
553
+
554
+ _connections.insert(pair<const ConnectorPtr, ConnectionIPtr>(ci.connector, connection));
555
+ _connectionsByEndpoint.insert(pair<const EndpointIPtr, ConnectionIPtr>(connection->endpoint(), connection));
556
+ _connectionsByEndpoint.insert(pair<const EndpointIPtr, ConnectionIPtr>(connection->endpoint()->compress(true),
557
+ connection));
558
+ return connection;
559
+ }
560
+
561
+ void
562
+ IceInternal::OutgoingConnectionFactory::finishGetConnection(const vector<ConnectorInfo>& connectors,
563
+ const ConnectorInfo& ci,
564
+ const ConnectionIPtr& connection,
565
+ const ConnectCallbackPtr& cb)
566
+ {
567
+ set<ConnectCallbackPtr> connectionCallbacks;
568
+ if(cb)
569
+ {
570
+ connectionCallbacks.insert(cb);
571
+ }
572
+
573
+ set<ConnectCallbackPtr> callbacks;
574
+ {
575
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
576
+ for(vector<ConnectorInfo>::const_iterator p = connectors.begin(); p != connectors.end(); ++p)
577
+ {
578
+ map<ConnectorPtr, set<ConnectCallbackPtr> >::iterator q = _pending.find(p->connector);
579
+ if(q != _pending.end())
580
+ {
581
+ for(set<ConnectCallbackPtr>::const_iterator r = q->second.begin(); r != q->second.end(); ++r)
582
+ {
583
+ if((*r)->hasConnector(ci))
584
+ {
585
+ connectionCallbacks.insert(*r);
586
+ }
587
+ else
588
+ {
589
+ callbacks.insert(*r);
590
+ }
591
+ }
592
+ _pending.erase(q);
593
+ }
594
+ }
595
+
596
+ for(set<ConnectCallbackPtr>::iterator r = connectionCallbacks.begin(); r != connectionCallbacks.end(); ++r)
597
+ {
598
+ (*r)->removeFromPending();
599
+ callbacks.erase(*r);
600
+ }
601
+ for(set<ConnectCallbackPtr>::iterator r = callbacks.begin(); r != callbacks.end(); ++r)
602
+ {
603
+ (*r)->removeFromPending();
604
+ }
605
+ notifyAll();
606
+ }
607
+
608
+ bool compress;
609
+ DefaultsAndOverridesPtr defaultsAndOverrides = _instance->defaultsAndOverrides();
610
+ if(defaultsAndOverrides->overrideCompress)
611
+ {
612
+ compress = defaultsAndOverrides->overrideCompressValue;
613
+ }
614
+ else
615
+ {
616
+ compress = ci.endpoint->compress();
617
+ }
618
+
619
+ for(set<ConnectCallbackPtr>::const_iterator p = callbacks.begin(); p != callbacks.end(); ++p)
620
+ {
621
+ (*p)->getConnection();
622
+ }
623
+ for(set<ConnectCallbackPtr>::const_iterator p = connectionCallbacks.begin(); p != connectionCallbacks.end(); ++p)
624
+ {
625
+ (*p)->setConnection(connection, compress);
626
+ }
627
+ }
628
+
629
+ void
630
+ IceInternal::OutgoingConnectionFactory::finishGetConnection(const vector<ConnectorInfo>& connectors,
631
+ const Ice::LocalException& ex,
632
+ const ConnectCallbackPtr& cb)
633
+ {
634
+ set<ConnectCallbackPtr> failedCallbacks;
635
+ if(cb)
636
+ {
637
+ failedCallbacks.insert(cb);
638
+ }
639
+
640
+ set<ConnectCallbackPtr> callbacks;
641
+ {
642
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
643
+ for(vector<ConnectorInfo>::const_iterator p = connectors.begin(); p != connectors.end(); ++p)
644
+ {
645
+ map<ConnectorPtr, set<ConnectCallbackPtr> >::iterator q = _pending.find(p->connector);
646
+ if(q != _pending.end())
647
+ {
648
+ for(set<ConnectCallbackPtr>::const_iterator r = q->second.begin(); r != q->second.end(); ++r)
649
+ {
650
+ if((*r)->removeConnectors(connectors))
651
+ {
652
+ failedCallbacks.insert(*r);
653
+ }
654
+ else
655
+ {
656
+ callbacks.insert(*r);
657
+ }
658
+ }
659
+ _pending.erase(q);
660
+ }
661
+ }
662
+
663
+ for(set<ConnectCallbackPtr>::iterator r = callbacks.begin(); r != callbacks.end(); ++r)
664
+ {
665
+ assert(failedCallbacks.find(*r) == failedCallbacks.end());
666
+ (*r)->removeFromPending();
667
+ }
668
+ notifyAll();
669
+ }
670
+
671
+ for(set<ConnectCallbackPtr>::const_iterator p = callbacks.begin(); p != callbacks.end(); ++p)
672
+ {
673
+ (*p)->getConnection();
674
+ }
675
+ for(set<ConnectCallbackPtr>::const_iterator p = failedCallbacks.begin(); p != failedCallbacks.end(); ++p)
676
+ {
677
+ (*p)->setException(ex);
678
+ }
679
+ }
680
+
681
+ bool
682
+ IceInternal::OutgoingConnectionFactory::addToPending(const ConnectCallbackPtr& cb,
683
+ const vector<ConnectorInfo>& connectors)
684
+ {
685
+ //
686
+ // Add the callback to each connector pending list.
687
+ //
688
+ bool found = false;
689
+ for(vector<ConnectorInfo>::const_iterator p = connectors.begin(); p != connectors.end(); ++p)
690
+ {
691
+ map<ConnectorPtr, set<ConnectCallbackPtr> >::iterator q = _pending.find(p->connector);
692
+ if(q != _pending.end())
693
+ {
694
+ found = true;
695
+ if(cb)
696
+ {
697
+ q->second.insert(cb);
698
+ }
699
+ }
700
+ }
701
+
702
+ if(found)
703
+ {
704
+ return true;
705
+ }
706
+
707
+ //
708
+ // If there's no pending connection for the given connectors, we're
709
+ // responsible for its establishment. We add empty pending lists,
710
+ // other callbacks to the same connectors will be queued.
711
+ //
712
+ for(vector<ConnectorInfo>::const_iterator r = connectors.begin(); r != connectors.end(); ++r)
713
+ {
714
+ if(_pending.find(r->connector) == _pending.end())
715
+ {
716
+ _pending.insert(pair<ConnectorPtr, set<ConnectCallbackPtr> >(r->connector, set<ConnectCallbackPtr>()));
717
+ }
718
+ }
719
+ return false;
720
+ }
721
+
722
+ void
723
+ IceInternal::OutgoingConnectionFactory::removeFromPending(const ConnectCallbackPtr& cb,
724
+ const vector<ConnectorInfo>& connectors)
725
+ {
726
+ for(vector<ConnectorInfo>::const_iterator p = connectors.begin(); p != connectors.end(); ++p)
727
+ {
728
+ map<ConnectorPtr, set<ConnectCallbackPtr> >::iterator q = _pending.find(p->connector);
729
+ if(q != _pending.end())
730
+ {
731
+ q->second.erase(cb);
732
+ }
733
+ }
734
+ }
735
+
736
+ void
737
+ IceInternal::OutgoingConnectionFactory::handleException(const LocalException& ex, bool hasMore)
738
+ {
739
+ TraceLevelsPtr traceLevels = _instance->traceLevels();
740
+ if(traceLevels->retry >= 2)
741
+ {
742
+ Trace out(_instance->initializationData().logger, traceLevels->retryCat);
743
+
744
+ out << "couldn't resolve endpoint host";
745
+ if(dynamic_cast<const CommunicatorDestroyedException*>(&ex))
746
+ {
747
+ out << "\n";
748
+ }
749
+ else
750
+ {
751
+ if(hasMore)
752
+ {
753
+ out << ", trying next endpoint\n";
754
+ }
755
+ else
756
+ {
757
+ out << " and no more endpoints to try\n";
758
+ }
759
+ }
760
+ out << ex;
761
+ }
762
+ }
763
+
764
+ void
765
+ IceInternal::OutgoingConnectionFactory::handleConnectionException(const LocalException& ex, bool hasMore)
766
+ {
767
+ TraceLevelsPtr traceLevels = _instance->traceLevels();
768
+ if(traceLevels->retry >= 2)
769
+ {
770
+ Trace out(_instance->initializationData().logger, traceLevels->retryCat);
771
+
772
+ out << "connection to endpoint failed";
773
+ if(dynamic_cast<const CommunicatorDestroyedException*>(&ex))
774
+ {
775
+ out << "\n";
776
+ }
777
+ else
778
+ {
779
+ if(hasMore)
780
+ {
781
+ out << ", trying next endpoint\n";
782
+ }
783
+ else
784
+ {
785
+ out << " and no more endpoints to try\n";
786
+ }
787
+ }
788
+ out << ex;
789
+ }
790
+ }
791
+
792
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::ConnectCallback(const InstancePtr& instance,
793
+ const OutgoingConnectionFactoryPtr& factory,
794
+ const vector<EndpointIPtr>& endpoints,
795
+ bool hasMore,
796
+ const CreateConnectionCallbackPtr& cb,
797
+ Ice::EndpointSelectionType selType) :
798
+ _instance(instance),
799
+ _factory(factory),
800
+ _endpoints(endpoints),
801
+ _hasMore(hasMore),
802
+ _callback(cb),
803
+ _selType(selType)
804
+ {
805
+ _endpointsIter = _endpoints.begin();
806
+ }
807
+
808
+ //
809
+ // Methods from ConnectionI.StartCallback
810
+ //
811
+ void
812
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::connectionStartCompleted(const ConnectionIPtr& connection)
813
+ {
814
+ if(_observer)
815
+ {
816
+ _observer->detach();
817
+ }
818
+
819
+ connection->activate();
820
+ _factory->finishGetConnection(_connectors, *_iter, connection, this);
821
+ }
822
+
823
+ void
824
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::connectionStartFailed(const ConnectionIPtr& /*connection*/,
825
+ const LocalException& ex)
826
+ {
827
+ assert(_iter != _connectors.end());
828
+
829
+ if(_observer)
830
+ {
831
+ _observer->failed(ex.ice_name());
832
+ _observer->detach();
833
+ }
834
+
835
+ _factory->handleConnectionException(ex, _hasMore || _iter != _connectors.end() - 1);
836
+ if(dynamic_cast<const Ice::CommunicatorDestroyedException*>(&ex)) // No need to continue.
837
+ {
838
+ _factory->finishGetConnection(_connectors, ex, this);
839
+ }
840
+ else if(++_iter != _connectors.end()) // Try the next connector.
841
+ {
842
+ nextConnector();
843
+ }
844
+ else
845
+ {
846
+ _factory->finishGetConnection(_connectors, ex, this);
847
+ }
848
+ }
849
+
850
+ //
851
+ // Methods from EndpointI_connectors
852
+ //
853
+ void
854
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::connectors(const vector<ConnectorPtr>& connectors)
855
+ {
856
+ for(vector<ConnectorPtr>::const_iterator p = connectors.begin(); p != connectors.end(); ++p)
857
+ {
858
+ _connectors.push_back(ConnectorInfo(*p, *_endpointsIter));
859
+ }
860
+
861
+ if(++_endpointsIter != _endpoints.end())
862
+ {
863
+ nextEndpoint();
864
+ }
865
+ else
866
+ {
867
+ assert(!_connectors.empty());
868
+
869
+ //
870
+ // We now have all the connectors for the given endpoints. We can try to obtain the
871
+ // connection.
872
+ //
873
+ _iter = _connectors.begin();
874
+ getConnection();
875
+ }
876
+ }
877
+
878
+ void
879
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::exception(const Ice::LocalException& ex)
880
+ {
881
+ _factory->handleException(ex, _hasMore || _endpointsIter != _endpoints.end() - 1);
882
+ if(++_endpointsIter != _endpoints.end())
883
+ {
884
+ nextEndpoint();
885
+ }
886
+ else if(!_connectors.empty())
887
+ {
888
+ //
889
+ // We now have all the connectors for the given endpoints. We can try to obtain the
890
+ // connection.
891
+ //
892
+ _iter = _connectors.begin();
893
+ getConnection();
894
+ }
895
+ else
896
+ {
897
+ _callback->setException(ex);
898
+ _factory->decPendingConnectCount(); // Must be called last.
899
+ }
900
+ }
901
+
902
+ void
903
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::getConnectors()
904
+ {
905
+ try
906
+ {
907
+ //
908
+ // Notify the factory that there's an async connect pending. This is necessary
909
+ // to prevent the outgoing connection factory to be destroyed before all the
910
+ // pending asynchronous connects are finished.
911
+ //
912
+ _factory->incPendingConnectCount();
913
+ }
914
+ catch(const Ice::LocalException& ex)
915
+ {
916
+ _callback->setException(ex);
917
+ return;
918
+ }
919
+
920
+ nextEndpoint();
921
+ }
922
+
923
+ void
924
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::nextEndpoint()
925
+ {
926
+ try
927
+ {
928
+ assert(_endpointsIter != _endpoints.end());
929
+ (*_endpointsIter)->connectors_async(_selType, this);
930
+ }
931
+ catch(const Ice::LocalException& ex)
932
+ {
933
+ exception(ex);
934
+ }
935
+ }
936
+
937
+ void
938
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::getConnection()
939
+ {
940
+ try
941
+ {
942
+ //
943
+ // If all the connectors have been created, we ask the factory to get a
944
+ // connection.
945
+ //
946
+ bool compress;
947
+ Ice::ConnectionIPtr connection = _factory->getConnection(_connectors, this, compress);
948
+ if(!connection)
949
+ {
950
+ //
951
+ // A null return value from getConnection indicates that the connection
952
+ // is being established and that everthing has been done to ensure that
953
+ // the callback will be notified when the connection establishment is
954
+ // done or that the callback already obtain the connection.
955
+ //
956
+ return;
957
+ }
958
+
959
+ _callback->setConnection(connection, compress);
960
+ _factory->decPendingConnectCount(); // Must be called last.
961
+ }
962
+ catch(const Ice::LocalException& ex)
963
+ {
964
+ _callback->setException(ex);
965
+ _factory->decPendingConnectCount(); // Must be called last.
966
+ }
967
+ }
968
+
969
+ void
970
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::nextConnector()
971
+ {
972
+ Ice::ConnectionIPtr connection;
973
+ try
974
+ {
975
+
976
+ const CommunicatorObserverPtr& obsv = _factory->_instance->initializationData().observer;
977
+ if(obsv)
978
+ {
979
+ _observer = obsv->getConnectionEstablishmentObserver(_iter->endpoint, _iter->connector->toString());
980
+ if(_observer)
981
+ {
982
+ _observer->attach();
983
+ }
984
+ }
985
+
986
+ assert(_iter != _connectors.end());
987
+
988
+ if(_instance->traceLevels()->network >= 2)
989
+ {
990
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
991
+ out << "trying to establish " << _iter->endpoint->protocol() << " connection to "
992
+ << _iter->connector->toString();
993
+ }
994
+ connection = _factory->createConnection(_iter->connector->connect(), *_iter);
995
+ connection->start(this);
996
+ }
997
+ catch(const Ice::LocalException& ex)
998
+ {
999
+ if(_instance->traceLevels()->network >= 2)
1000
+ {
1001
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1002
+ out << "failed to establish " << _iter->endpoint->protocol() << " connection to "
1003
+ << _iter->connector->toString() << "\n" << ex;
1004
+ }
1005
+ connectionStartFailed(connection, ex);
1006
+ }
1007
+ }
1008
+
1009
+ void
1010
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::setConnection(const Ice::ConnectionIPtr& connection,
1011
+ bool compress)
1012
+ {
1013
+ //
1014
+ // Callback from the factory: the connection to one of the callback
1015
+ // connectors has been established.
1016
+ //
1017
+ _callback->setConnection(connection, compress);
1018
+ _factory->decPendingConnectCount(); // Must be called last.
1019
+ }
1020
+
1021
+ void
1022
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::setException(const Ice::LocalException& ex)
1023
+ {
1024
+ //
1025
+ // Callback from the factory: connection establishment failed.
1026
+ //
1027
+ _callback->setException(ex);
1028
+ _factory->decPendingConnectCount(); // Must be called last.
1029
+ }
1030
+
1031
+ bool
1032
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::hasConnector(const ConnectorInfo& ci)
1033
+ {
1034
+ return find(_connectors.begin(), _connectors.end(), ci) != _connectors.end();
1035
+ }
1036
+
1037
+ bool
1038
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::removeConnectors(const vector<ConnectorInfo>& connectors)
1039
+ {
1040
+ //
1041
+ // Callback from the factory: connecting to the given connectors
1042
+ // failed, we remove the connectors and return true if there's
1043
+ // no more connectors left to try.
1044
+ //
1045
+ for(vector<ConnectorInfo>::const_iterator p = connectors.begin(); p != connectors.end(); ++p)
1046
+ {
1047
+ _connectors.erase(remove(_connectors.begin(), _connectors.end(), *p), _connectors.end());
1048
+ }
1049
+ return _connectors.empty();
1050
+ }
1051
+
1052
+ void
1053
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::removeFromPending()
1054
+ {
1055
+ _factory->removeFromPending(this, _connectors);
1056
+ }
1057
+
1058
+ bool
1059
+ IceInternal::OutgoingConnectionFactory::ConnectCallback::operator<(const ConnectCallback& rhs) const
1060
+ {
1061
+ return this < &rhs;
1062
+ }
1063
+
1064
+ void
1065
+ IceInternal::IncomingConnectionFactory::activate()
1066
+ {
1067
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1068
+ setState(StateActive);
1069
+ }
1070
+
1071
+ void
1072
+ IceInternal::IncomingConnectionFactory::hold()
1073
+ {
1074
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1075
+ setState(StateHolding);
1076
+ }
1077
+
1078
+ void
1079
+ IceInternal::IncomingConnectionFactory::destroy()
1080
+ {
1081
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1082
+ setState(StateClosed);
1083
+ }
1084
+
1085
+ void
1086
+ IceInternal::IncomingConnectionFactory::updateConnectionObservers()
1087
+ {
1088
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1089
+ for_each(_connections.begin(), _connections.end(), Ice::voidMemFun(&ConnectionI::updateObserver));
1090
+ }
1091
+
1092
+ void
1093
+ IceInternal::IncomingConnectionFactory::waitUntilHolding() const
1094
+ {
1095
+ set<ConnectionIPtr> connections;
1096
+
1097
+ {
1098
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1099
+
1100
+ //
1101
+ // First we wait until the connection factory itself is in holding
1102
+ // state.
1103
+ //
1104
+ while(_state < StateHolding)
1105
+ {
1106
+ wait();
1107
+ }
1108
+
1109
+ //
1110
+ // We want to wait until all connections are in holding state
1111
+ // outside the thread synchronization.
1112
+ //
1113
+ connections = _connections;
1114
+ }
1115
+
1116
+ //
1117
+ // Now we wait until each connection is in holding state.
1118
+ //
1119
+ for_each(connections.begin(), connections.end(), Ice::constVoidMemFun(&ConnectionI::waitUntilHolding));
1120
+ }
1121
+
1122
+ void
1123
+ IceInternal::IncomingConnectionFactory::waitUntilFinished()
1124
+ {
1125
+ set<ConnectionIPtr> connections;
1126
+ {
1127
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1128
+
1129
+ //
1130
+ // First we wait until the factory is destroyed. If we are using
1131
+ // an acceptor, we also wait for it to be closed.
1132
+ //
1133
+ while(_state != StateFinished)
1134
+ {
1135
+ wait();
1136
+ }
1137
+
1138
+ //
1139
+ // Clear the OA. See bug 1673 for the details of why this is necessary.
1140
+ //
1141
+ _adapter = 0;
1142
+
1143
+ // We want to wait until all connections are finished outside the
1144
+ // thread synchronization.
1145
+ //
1146
+ connections = _connections;
1147
+ }
1148
+
1149
+ for_each(connections.begin(), connections.end(), Ice::voidMemFun(&ConnectionI::waitUntilFinished));
1150
+
1151
+ {
1152
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1153
+ if(_transceiver)
1154
+ {
1155
+ assert(_connections.size() <= 1); // The connection isn't monitored or reaped.
1156
+ }
1157
+ else
1158
+ {
1159
+ // Ensure all the connections are finished and reapable at this point.
1160
+ vector<Ice::ConnectionIPtr> cons;
1161
+ _monitor->swapReapedConnections(cons);
1162
+ assert(cons.size() == _connections.size());
1163
+ cons.clear();
1164
+ }
1165
+ _connections.clear();
1166
+ _monitor->destroy();
1167
+ }
1168
+ }
1169
+
1170
+ EndpointIPtr
1171
+ IceInternal::IncomingConnectionFactory::endpoint() const
1172
+ {
1173
+ // No mutex protection necessary, _endpoint is immutable.
1174
+ return _endpoint;
1175
+ }
1176
+
1177
+ list<ConnectionIPtr>
1178
+ IceInternal::IncomingConnectionFactory::connections() const
1179
+ {
1180
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1181
+
1182
+ list<ConnectionIPtr> result;
1183
+
1184
+ //
1185
+ // Only copy connections which have not been destroyed.
1186
+ //
1187
+ remove_copy_if(_connections.begin(), _connections.end(), back_inserter(result),
1188
+ not1(Ice::constMemFun(&ConnectionI::isActiveOrHolding)));
1189
+
1190
+ return result;
1191
+ }
1192
+
1193
+ void
1194
+ IceInternal::IncomingConnectionFactory::flushAsyncBatchRequests(const CommunicatorFlushBatchPtr& outAsync)
1195
+ {
1196
+ list<ConnectionIPtr> c = connections(); // connections() is synchronized, so no need to synchronize here.
1197
+
1198
+ for(list<ConnectionIPtr>::const_iterator p = c.begin(); p != c.end(); ++p)
1199
+ {
1200
+ try
1201
+ {
1202
+ outAsync->flushConnection(*p);
1203
+ }
1204
+ catch(const LocalException&)
1205
+ {
1206
+ // Ignore.
1207
+ }
1208
+ }
1209
+ }
1210
+
1211
+ #if defined(ICE_USE_IOCP) || defined(ICE_OS_WINRT)
1212
+ bool
1213
+ IceInternal::IncomingConnectionFactory::startAsync(SocketOperation)
1214
+ {
1215
+ if(_state >= StateClosed)
1216
+ {
1217
+ return false;
1218
+ }
1219
+
1220
+ try
1221
+ {
1222
+ _acceptor->startAccept();
1223
+ }
1224
+ catch(const Ice::LocalException& ex)
1225
+ {
1226
+ {
1227
+ Error out(_instance->initializationData().logger);
1228
+ out << "can't accept connections:\n" << ex << '\n' << _acceptor->toString();
1229
+ }
1230
+ abort();
1231
+ }
1232
+ return true;
1233
+ }
1234
+
1235
+ bool
1236
+ IceInternal::IncomingConnectionFactory::finishAsync(SocketOperation)
1237
+ {
1238
+ assert(_acceptor);
1239
+ try
1240
+ {
1241
+ _acceptor->finishAccept();
1242
+ }
1243
+ catch(const LocalException& ex)
1244
+ {
1245
+ Error out(_instance->initializationData().logger);
1246
+ out << "couldn't accept connection:\n" << ex << '\n' << _acceptor->toString();
1247
+ return false;
1248
+ }
1249
+ return _state < StateClosed;
1250
+ }
1251
+ #endif
1252
+
1253
+ void
1254
+ IceInternal::IncomingConnectionFactory::message(ThreadPoolCurrent& current)
1255
+ {
1256
+ ConnectionIPtr connection;
1257
+
1258
+ ThreadPoolMessage<IncomingConnectionFactory> msg(current, *this);
1259
+
1260
+ {
1261
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1262
+
1263
+ ThreadPoolMessage<IncomingConnectionFactory>::IOScope io(msg);
1264
+ if(!io)
1265
+ {
1266
+ return;
1267
+ }
1268
+
1269
+ if(_state >= StateClosed)
1270
+ {
1271
+ return;
1272
+ }
1273
+ else if(_state == StateHolding)
1274
+ {
1275
+ IceUtil::ThreadControl::yield();
1276
+ return;
1277
+ }
1278
+
1279
+ //
1280
+ // Reap closed connections
1281
+ //
1282
+ vector<Ice::ConnectionIPtr> cons;
1283
+ _monitor->swapReapedConnections(cons);
1284
+ for(vector<Ice::ConnectionIPtr>::const_iterator p = cons.begin(); p != cons.end(); ++p)
1285
+ {
1286
+ _connections.erase(*p);
1287
+ }
1288
+
1289
+ //
1290
+ // Now accept a new connection.
1291
+ //
1292
+ TransceiverPtr transceiver;
1293
+ try
1294
+ {
1295
+ transceiver = _acceptor->accept();
1296
+
1297
+ if(_instance->traceLevels()->network >= 2)
1298
+ {
1299
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1300
+ out << "trying to accept " << _endpoint->protocol() << " connection\n" << transceiver->toString();
1301
+ }
1302
+ }
1303
+ catch(const SocketException& ex)
1304
+ {
1305
+ if(noMoreFds(ex.error))
1306
+ {
1307
+ {
1308
+ Error out(_instance->initializationData().logger);
1309
+ out << "fatal error: can't accept more connections:\n" << ex << '\n' << _acceptor->toString();
1310
+ }
1311
+ abort();
1312
+ }
1313
+
1314
+ // Ignore socket exceptions.
1315
+ return;
1316
+ }
1317
+ catch(const LocalException& ex)
1318
+ {
1319
+ // Warn about other Ice local exceptions.
1320
+ if(_warn)
1321
+ {
1322
+ Warning out(_instance->initializationData().logger);
1323
+ out << "connection exception:\n" << ex << '\n' << _acceptor->toString();
1324
+ }
1325
+ return;
1326
+ }
1327
+
1328
+ assert(transceiver);
1329
+
1330
+ try
1331
+ {
1332
+ connection = new ConnectionI(_adapter->getCommunicator(), _instance, _monitor, transceiver, 0, _endpoint,
1333
+ _adapter);
1334
+ }
1335
+ catch(const LocalException& ex)
1336
+ {
1337
+ try
1338
+ {
1339
+ transceiver->close();
1340
+ }
1341
+ catch(const Ice::LocalException&)
1342
+ {
1343
+ // Ignore.
1344
+ }
1345
+
1346
+ if(_warn)
1347
+ {
1348
+ Warning out(_instance->initializationData().logger);
1349
+ out << "connection exception:\n" << ex << '\n' << _acceptor->toString();
1350
+ }
1351
+ return;
1352
+ }
1353
+
1354
+ _connections.insert(connection);
1355
+ }
1356
+
1357
+ assert(connection);
1358
+ connection->start(this);
1359
+ }
1360
+
1361
+ void
1362
+ IceInternal::IncomingConnectionFactory::finished(ThreadPoolCurrent&, bool close)
1363
+ {
1364
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1365
+ assert(_state == StateClosed);
1366
+ setState(StateFinished);
1367
+
1368
+ assert(_acceptor);
1369
+
1370
+ if(close)
1371
+ {
1372
+ closeAcceptor(true);
1373
+ }
1374
+ }
1375
+
1376
+ string
1377
+ IceInternal::IncomingConnectionFactory::toString() const
1378
+ {
1379
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1380
+
1381
+ if(_transceiver)
1382
+ {
1383
+ return _transceiver->toString();
1384
+ }
1385
+
1386
+ assert(_acceptor);
1387
+ return _acceptor->toString();
1388
+ }
1389
+
1390
+ NativeInfoPtr
1391
+ IceInternal::IncomingConnectionFactory::getNativeInfo()
1392
+ {
1393
+ if(_transceiver)
1394
+ {
1395
+ return _transceiver->getNativeInfo();
1396
+ }
1397
+
1398
+ assert(_acceptor);
1399
+ return _acceptor->getNativeInfo();
1400
+ }
1401
+
1402
+ void
1403
+ IceInternal::IncomingConnectionFactory::connectionStartCompleted(const Ice::ConnectionIPtr& connection)
1404
+ {
1405
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1406
+
1407
+ //
1408
+ // Initialy, connections are in the holding state. If the factory is active
1409
+ // we activate the connection.
1410
+ //
1411
+ if(_state == StateActive)
1412
+ {
1413
+ connection->activate();
1414
+ }
1415
+ }
1416
+
1417
+ void
1418
+ IceInternal::IncomingConnectionFactory::connectionStartFailed(const Ice::ConnectionIPtr& /*connection*/,
1419
+ const Ice::LocalException& ex)
1420
+ {
1421
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
1422
+ if(_state >= StateClosed)
1423
+ {
1424
+ return;
1425
+ }
1426
+
1427
+ //
1428
+ // Do not warn about connection exceptions here. The connection is not yet validated.
1429
+ //
1430
+ }
1431
+
1432
+ //
1433
+ // COMPILERFIX: The ConnectionFactory setup is broken out into a separate initialize
1434
+ // function because when it was part of the constructor C++Builder 2007 apps would
1435
+ // crash if an execption was thrown from any calls within the constructor.
1436
+ //
1437
+ IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const InstancePtr& instance,
1438
+ const EndpointIPtr& endpoint,
1439
+ const ObjectAdapterIPtr& adapter) :
1440
+ _instance(instance),
1441
+ _monitor(new FactoryACMMonitor(instance, dynamic_cast<ObjectAdapterI*>(adapter.get())->getACM())),
1442
+ _endpoint(endpoint),
1443
+ _adapter(adapter),
1444
+ _warn(_instance->initializationData().properties->getPropertyAsInt("Ice.Warn.Connections") > 0),
1445
+ _state(StateHolding)
1446
+ {
1447
+ }
1448
+
1449
+ void
1450
+ IceInternal::IncomingConnectionFactory::initialize(const string& oaName)
1451
+ {
1452
+ if(_instance->defaultsAndOverrides()->overrideTimeout)
1453
+ {
1454
+ const_cast<EndpointIPtr&>(_endpoint) =
1455
+ _endpoint->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue);
1456
+ }
1457
+
1458
+ if(_instance->defaultsAndOverrides()->overrideCompress)
1459
+ {
1460
+ const_cast<EndpointIPtr&>(_endpoint) =
1461
+ _endpoint->compress(_instance->defaultsAndOverrides()->overrideCompressValue);
1462
+ }
1463
+
1464
+ try
1465
+ {
1466
+ const_cast<TransceiverPtr&>(_transceiver) = _endpoint->transceiver();
1467
+ if(_transceiver)
1468
+ {
1469
+ if(_instance->traceLevels()->network >= 2)
1470
+ {
1471
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1472
+ out << "attempting to bind to " << _endpoint->protocol() << " socket\n" << _transceiver->toString();
1473
+ }
1474
+ const_cast<EndpointIPtr&>(_endpoint) = _transceiver->bind();
1475
+
1476
+ ConnectionIPtr connection = new ConnectionI(_adapter->getCommunicator(), _instance, 0, _transceiver, 0,
1477
+ _endpoint, _adapter);
1478
+ connection->start(0);
1479
+ _connections.insert(connection);
1480
+ }
1481
+ else
1482
+ {
1483
+ const_cast<AcceptorPtr&>(_acceptor) = _endpoint->acceptor(oaName);
1484
+ assert(_acceptor);
1485
+
1486
+ if(_instance->traceLevels()->network >= 2)
1487
+ {
1488
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1489
+ out << "attempting to bind to " << _endpoint->protocol() << " socket " << _acceptor->toString();
1490
+ }
1491
+
1492
+ const_cast<EndpointIPtr&>(_endpoint) = _acceptor->listen();
1493
+
1494
+ if(_instance->traceLevels()->network >= 1)
1495
+ {
1496
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1497
+ out << "listening for " << _endpoint->protocol() << " connections\n" << _acceptor->toDetailedString();
1498
+ }
1499
+
1500
+ _adapter->getThreadPool()->initialize(this);
1501
+ }
1502
+ }
1503
+ catch(const Ice::Exception&)
1504
+ {
1505
+ if(_transceiver)
1506
+ {
1507
+ try
1508
+ {
1509
+ _transceiver->close();
1510
+ }
1511
+ catch(const Ice::LocalException&)
1512
+ {
1513
+ // Ignore
1514
+ }
1515
+ }
1516
+
1517
+
1518
+ if(_acceptor)
1519
+ {
1520
+ try
1521
+ {
1522
+ closeAcceptor(false);
1523
+ }
1524
+ catch(const Ice::LocalException&)
1525
+ {
1526
+ // Ignore
1527
+ }
1528
+ }
1529
+
1530
+ _state = StateFinished;
1531
+ _monitor->destroy();
1532
+ _connections.clear();
1533
+ throw;
1534
+ }
1535
+ }
1536
+
1537
+ IceInternal::IncomingConnectionFactory::~IncomingConnectionFactory()
1538
+ {
1539
+ assert(_state == StateFinished);
1540
+ assert(_connections.empty());
1541
+ }
1542
+
1543
+ void
1544
+ IceInternal::IncomingConnectionFactory::setState(State state)
1545
+ {
1546
+ if(_state == state) // Don't switch twice.
1547
+ {
1548
+ return;
1549
+ }
1550
+
1551
+ switch(state)
1552
+ {
1553
+ case StateActive:
1554
+ {
1555
+ if(_state != StateHolding) // Can only switch from holding to active.
1556
+ {
1557
+ return;
1558
+ }
1559
+ if(_acceptor)
1560
+ {
1561
+ if(_instance->traceLevels()->network >= 1)
1562
+ {
1563
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1564
+ out << "accepting " << _endpoint->protocol() << " connections at " << _acceptor->toString();
1565
+ }
1566
+ _adapter->getThreadPool()->_register(this, SocketOperationRead);
1567
+ }
1568
+ for_each(_connections.begin(), _connections.end(), Ice::voidMemFun(&ConnectionI::activate));
1569
+ break;
1570
+ }
1571
+
1572
+ case StateHolding:
1573
+ {
1574
+ if(_state != StateActive) // Can only switch from active to holding.
1575
+ {
1576
+ return;
1577
+ }
1578
+ if(_acceptor)
1579
+ {
1580
+ if(_instance->traceLevels()->network >= 1)
1581
+ {
1582
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1583
+ out << "holding " << _endpoint->protocol() << " connections at " << _acceptor->toString();
1584
+ }
1585
+ _adapter->getThreadPool()->unregister(this, SocketOperationRead);
1586
+ }
1587
+ for_each(_connections.begin(), _connections.end(), Ice::voidMemFun(&ConnectionI::hold));
1588
+ break;
1589
+ }
1590
+
1591
+ case StateClosed:
1592
+ {
1593
+ if(_acceptor)
1594
+ {
1595
+ //
1596
+ // If possible, close the acceptor now to prevent new connections from
1597
+ // being accepted while we are deactivating. This is especially useful
1598
+ // if there are no more threads in the thread pool available to dispatch
1599
+ // the finish() call. Not all selector implementations do support this
1600
+ // however.
1601
+ //
1602
+ if(_adapter->getThreadPool()->finish(this, true))
1603
+ {
1604
+ closeAcceptor(true);
1605
+ }
1606
+ }
1607
+ else
1608
+ {
1609
+ state = StateFinished;
1610
+ }
1611
+
1612
+ for_each(_connections.begin(), _connections.end(),
1613
+ bind2nd(Ice::voidMemFun1(&ConnectionI::destroy), ConnectionI::ObjectAdapterDeactivated));
1614
+ break;
1615
+ }
1616
+
1617
+ case StateFinished:
1618
+ {
1619
+ assert(_state == StateClosed);
1620
+ break;
1621
+ }
1622
+ }
1623
+
1624
+ _state = state;
1625
+ notifyAll();
1626
+ }
1627
+
1628
+ void
1629
+ IceInternal::IncomingConnectionFactory::closeAcceptor(bool trace)
1630
+ {
1631
+ if(trace && _instance->traceLevels()->network >= 1)
1632
+ {
1633
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1634
+ out << "stopping to accept " << _endpoint->protocol() << " connections at " << _acceptor->toString();
1635
+ }
1636
+
1637
+ _acceptor->close();
1638
+ }
1639
+