rufus-lua-win 5.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +69 -0
- data/Rakefile +1 -0
- data/lib/rufus/lua/win.rb +18 -0
- data/lib/rufus/lua/win/version.rb +7 -0
- data/rufus-lua-win.gemspec +23 -0
- data/vendor/lua/bin/liblua.dll +0 -0
- data/vendor/lua/lib/lua/LuaXml.lua +119 -0
- data/vendor/lua/lib/lua/alien.lua +250 -0
- data/vendor/lua/lib/lua/alien/core.dll +0 -0
- data/vendor/lua/lib/lua/alien/struct.dll +0 -0
- data/vendor/lua/lib/lua/base.lua +536 -0
- data/vendor/lua/lib/lua/bin.lua +20 -0
- data/vendor/lua/lib/lua/bit.dll +0 -0
- data/vendor/lua/lib/lua/cdlua.dll +0 -0
- data/vendor/lua/lib/lua/cdluacontextplus.dll +0 -0
- data/vendor/lua/lib/lua/cdluagl.dll +0 -0
- data/vendor/lua/lib/lua/cdluaim.dll +0 -0
- data/vendor/lua/lib/lua/cdluapdf.dll +0 -0
- data/vendor/lua/lib/lua/copas.lua +543 -0
- data/vendor/lua/lib/lua/coxpcall.lua +57 -0
- data/vendor/lua/lib/lua/date.lua +745 -0
- data/vendor/lua/lib/lua/debug_ext.lua +84 -0
- data/vendor/lua/lib/lua/debug_init.lua +2 -0
- data/vendor/lua/lib/lua/des56.dll +0 -0
- data/vendor/lua/lib/lua/dist/config.lua +109 -0
- data/vendor/lua/lib/lua/dist/constraints.lua +271 -0
- data/vendor/lua/lib/lua/dist/depends.lua +601 -0
- data/vendor/lua/lib/lua/dist/git.lua +307 -0
- data/vendor/lua/lib/lua/dist/init.lua +278 -0
- data/vendor/lua/lib/lua/dist/manifest.lua +225 -0
- data/vendor/lua/lib/lua/dist/package.lua +583 -0
- data/vendor/lua/lib/lua/dist/sys.lua +367 -0
- data/vendor/lua/lib/lua/dist/utils.lua +130 -0
- data/vendor/lua/lib/lua/ex.dll +0 -0
- data/vendor/lua/lib/lua/fstable.lua +116 -0
- data/vendor/lua/lib/lua/getopt.lua +273 -0
- data/vendor/lua/lib/lua/git.lua +5 -0
- data/vendor/lua/lib/lua/git/core.dll +0 -0
- data/vendor/lua/lib/lua/git/objects.lua +121 -0
- data/vendor/lua/lib/lua/git/pack.lua +316 -0
- data/vendor/lua/lib/lua/git/protocol.lua +188 -0
- data/vendor/lua/lib/lua/git/repo.lua +283 -0
- data/vendor/lua/lib/lua/git/util.lua +233 -0
- data/vendor/lua/lib/lua/gzio.dll +0 -0
- data/vendor/lua/lib/lua/gzip.lua +81 -0
- data/vendor/lua/lib/lua/iconv.dll +0 -0
- data/vendor/lua/lib/lua/imlua.dll +0 -0
- data/vendor/lua/lib/lua/imlua_fftw.dll +0 -0
- data/vendor/lua/lib/lua/imlua_jp2.dll +0 -0
- data/vendor/lua/lib/lua/imlua_process.dll +0 -0
- data/vendor/lua/lib/lua/imlua_process_omp.dll +0 -0
- data/vendor/lua/lib/lua/io_ext.lua +115 -0
- data/vendor/lua/lib/lua/iuplua.dll +0 -0
- data/vendor/lua/lib/lua/iuplua_mglplot.dll +0 -0
- data/vendor/lua/lib/lua/iuplua_pplot.dll +0 -0
- data/vendor/lua/lib/lua/iupluacd.dll +0 -0
- data/vendor/lua/lib/lua/iupluacontrols.dll +0 -0
- data/vendor/lua/lib/lua/iupluagl.dll +0 -0
- data/vendor/lua/lib/lua/iupluaim.dll +0 -0
- data/vendor/lua/lib/lua/iupluaimglib.dll +0 -0
- data/vendor/lua/lib/lua/iupluatuio.dll +0 -0
- data/vendor/lua/lib/lua/lanes-keeper.lua +302 -0
- data/vendor/lua/lib/lua/lanes.lua +591 -0
- data/vendor/lua/lib/lua/lanes/core.dll +0 -0
- data/vendor/lua/lib/lua/lcs.lua +55 -0
- data/vendor/lua/lib/lua/lemock.lua +659 -0
- data/vendor/lua/lib/lua/lfs.dll +0 -0
- data/vendor/lua/lib/lua/list.lua +375 -0
- data/vendor/lua/lib/lua/logging.lua +189 -0
- data/vendor/lua/lib/lua/logging/console.lua +22 -0
- data/vendor/lua/lib/lua/logging/email.lua +44 -0
- data/vendor/lua/lib/lua/logging/file.lua +55 -0
- data/vendor/lua/lib/lua/logging/rolling_file.lua +81 -0
- data/vendor/lua/lib/lua/logging/socket.lua +35 -0
- data/vendor/lua/lib/lua/logging/sql.lua +64 -0
- data/vendor/lua/lib/lua/loop/base.lua +68 -0
- data/vendor/lua/lib/lua/loop/cached.lua +312 -0
- data/vendor/lua/lib/lua/loop/collection/MapWithArrayOfKeys.lua +64 -0
- data/vendor/lua/lib/lua/loop/collection/ObjectCache.lua +39 -0
- data/vendor/lua/lib/lua/loop/collection/OrderedSet.lua +164 -0
- data/vendor/lua/lib/lua/loop/collection/PriorityQueue.lua +86 -0
- data/vendor/lua/lib/lua/loop/collection/UnorderedArray.lua +32 -0
- data/vendor/lua/lib/lua/loop/collection/UnorderedArraySet.lua +56 -0
- data/vendor/lua/lib/lua/loop/compiler/Arguments.lua +108 -0
- data/vendor/lua/lib/lua/loop/compiler/Conditional.lua +50 -0
- data/vendor/lua/lib/lua/loop/compiler/Expression.lua +215 -0
- data/vendor/lua/lib/lua/loop/component/base.lua +221 -0
- data/vendor/lua/lib/lua/loop/component/contained.lua +71 -0
- data/vendor/lua/lib/lua/loop/component/dynamic.lua +223 -0
- data/vendor/lua/lib/lua/loop/component/intercepted.lua +354 -0
- data/vendor/lua/lib/lua/loop/component/wrapped.lua +195 -0
- data/vendor/lua/lib/lua/loop/debug/Inspector.lua +521 -0
- data/vendor/lua/lib/lua/loop/debug/Matcher.lua +192 -0
- data/vendor/lua/lib/lua/loop/debug/Verbose.lua +266 -0
- data/vendor/lua/lib/lua/loop/debug/Viewer.lua +200 -0
- data/vendor/lua/lib/lua/loop/multiple.lua +105 -0
- data/vendor/lua/lib/lua/loop/object/Exception.lua +57 -0
- data/vendor/lua/lib/lua/loop/object/Publisher.lua +43 -0
- data/vendor/lua/lib/lua/loop/object/Wrapper.lua +39 -0
- data/vendor/lua/lib/lua/loop/scoped.lua +585 -0
- data/vendor/lua/lib/lua/loop/serial/FileStream.lua +48 -0
- data/vendor/lua/lib/lua/loop/serial/Serializer.lua +291 -0
- data/vendor/lua/lib/lua/loop/serial/SocketStream.lua +51 -0
- data/vendor/lua/lib/lua/loop/serial/StringStream.lua +47 -0
- data/vendor/lua/lib/lua/loop/simple.lua +75 -0
- data/vendor/lua/lib/lua/loop/table.lua +71 -0
- data/vendor/lua/lib/lua/loop/thread/CoSocket.lua +416 -0
- data/vendor/lua/lib/lua/loop/thread/IOScheduler.lua +170 -0
- data/vendor/lua/lib/lua/loop/thread/Scheduler.lua +327 -0
- data/vendor/lua/lib/lua/loop/thread/SocketScheduler.lua +88 -0
- data/vendor/lua/lib/lua/loop/thread/Timer.lua +54 -0
- data/vendor/lua/lib/lua/lpeg.dll +0 -0
- data/vendor/lua/lib/lua/ltn12.lua +292 -0
- data/vendor/lua/lib/lua/luaXML_lib.dll +0 -0
- data/vendor/lua/lib/lua/luacurl.dll +0 -0
- data/vendor/lua/lib/lua/luadoc/config.lua +34 -0
- data/vendor/lua/lib/lua/luadoc/doclet/debug.lua +46 -0
- data/vendor/lua/lib/lua/luadoc/doclet/formatter.lua +84 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html.lua +289 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/file.lp +113 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/function.lp +64 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/index.lp +70 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/luadoc.css +286 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/menu.lp +55 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/module.lp +109 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/table.lp +15 -0
- data/vendor/lua/lib/lua/luadoc/doclet/raw.lua +12 -0
- data/vendor/lua/lib/lua/luadoc/init.lua +58 -0
- data/vendor/lua/lib/lua/luadoc/lp.lua +130 -0
- data/vendor/lua/lib/lua/luadoc/taglet/standard.lua +495 -0
- data/vendor/lua/lib/lua/luadoc/taglet/standard/tags.lua +171 -0
- data/vendor/lua/lib/lua/luadoc/util.lua +233 -0
- data/vendor/lua/lib/lua/luagl.dll +0 -0
- data/vendor/lua/lib/lua/luaglu.dll +0 -0
- data/vendor/lua/lib/lua/luaidl.lua +113 -0
- data/vendor/lua/lib/lua/luaidl/lex.lua +793 -0
- data/vendor/lua/lib/lua/luaidl/pre.lua +149 -0
- data/vendor/lua/lib/lua/luaidl/sin.lua +3631 -0
- data/vendor/lua/lib/lua/luarocks/add.lua +108 -0
- data/vendor/lua/lib/lua/luarocks/admin_remove.lua +87 -0
- data/vendor/lua/lib/lua/luarocks/build.lua +330 -0
- data/vendor/lua/lib/lua/luarocks/build/builtin.lua +253 -0
- data/vendor/lua/lib/lua/luarocks/build/cmake.lua +54 -0
- data/vendor/lua/lib/lua/luarocks/build/command.lua +32 -0
- data/vendor/lua/lib/lua/luarocks/build/make.lua +92 -0
- data/vendor/lua/lib/lua/luarocks/cache.lua +85 -0
- data/vendor/lua/lib/lua/luarocks/cfg.lua +449 -0
- data/vendor/lua/lib/lua/luarocks/command_line.lua +163 -0
- data/vendor/lua/lib/lua/luarocks/deps.lua +654 -0
- data/vendor/lua/lib/lua/luarocks/dir.lua +69 -0
- data/vendor/lua/lib/lua/luarocks/download.lua +90 -0
- data/vendor/lua/lib/lua/luarocks/fetch.lua +321 -0
- data/vendor/lua/lib/lua/luarocks/fetch/cvs.lua +44 -0
- data/vendor/lua/lib/lua/luarocks/fetch/git.lua +81 -0
- data/vendor/lua/lib/lua/luarocks/fetch/git_file.lua +17 -0
- data/vendor/lua/lib/lua/luarocks/fetch/hg.lua +54 -0
- data/vendor/lua/lib/lua/luarocks/fetch/sscm.lua +42 -0
- data/vendor/lua/lib/lua/luarocks/fetch/svn.lua +53 -0
- data/vendor/lua/lib/lua/luarocks/fs.lua +40 -0
- data/vendor/lua/lib/lua/luarocks/fs/lua.lua +676 -0
- data/vendor/lua/lib/lua/luarocks/fs/unix.lua +88 -0
- data/vendor/lua/lib/lua/luarocks/fs/unix/tools.lua +325 -0
- data/vendor/lua/lib/lua/luarocks/fs/win32.lua +107 -0
- data/vendor/lua/lib/lua/luarocks/fs/win32/tools.lua +334 -0
- data/vendor/lua/lib/lua/luarocks/help.lua +101 -0
- data/vendor/lua/lib/lua/luarocks/index.lua +172 -0
- data/vendor/lua/lib/lua/luarocks/install.lua +151 -0
- data/vendor/lua/lib/lua/luarocks/list.lua +35 -0
- data/vendor/lua/lib/lua/luarocks/loader.lua +228 -0
- data/vendor/lua/lib/lua/luarocks/make.lua +71 -0
- data/vendor/lua/lib/lua/luarocks/make_manifest.lua +34 -0
- data/vendor/lua/lib/lua/luarocks/manif.lua +360 -0
- data/vendor/lua/lib/lua/luarocks/manif_core.lua +75 -0
- data/vendor/lua/lib/lua/luarocks/new_version.lua +141 -0
- data/vendor/lua/lib/lua/luarocks/pack.lua +205 -0
- data/vendor/lua/lib/lua/luarocks/path.lua +315 -0
- data/vendor/lua/lib/lua/luarocks/persist.lua +173 -0
- data/vendor/lua/lib/lua/luarocks/refresh_cache.lua +30 -0
- data/vendor/lua/lib/lua/luarocks/remove.lua +135 -0
- data/vendor/lua/lib/lua/luarocks/rep.lua +313 -0
- data/vendor/lua/lib/lua/luarocks/require.lua +6 -0
- data/vendor/lua/lib/lua/luarocks/search.lua +399 -0
- data/vendor/lua/lib/lua/luarocks/show.lua +138 -0
- data/vendor/lua/lib/lua/luarocks/site_config.lua +23 -0
- data/vendor/lua/lib/lua/luarocks/tools/patch.lua +712 -0
- data/vendor/lua/lib/lua/luarocks/tools/tar.lua +144 -0
- data/vendor/lua/lib/lua/luarocks/tools/zip.lua +245 -0
- data/vendor/lua/lib/lua/luarocks/type_check.lua +267 -0
- data/vendor/lua/lib/lua/luarocks/unpack.lua +151 -0
- data/vendor/lua/lib/lua/luarocks/util.lua +420 -0
- data/vendor/lua/lib/lua/luarocks/validate.lua +164 -0
- data/vendor/lua/lib/lua/luars232.dll +0 -0
- data/vendor/lua/lib/lua/luasql/mysql.dll +0 -0
- data/vendor/lua/lib/lua/luasql/postgres.dll +0 -0
- data/vendor/lua/lib/lua/luasql/sqlite3.dll +0 -0
- data/vendor/lua/lib/lua/luaunit.lua +601 -0
- data/vendor/lua/lib/lua/lxp.dll +0 -0
- data/vendor/lua/lib/lua/lxp/lom.lua +60 -0
- data/vendor/lua/lib/lua/math_ext.lua +27 -0
- data/vendor/lua/lib/lua/mbox.lua +53 -0
- data/vendor/lua/lib/lua/md5.lua +19 -0
- data/vendor/lua/lib/lua/md5/core.dll +0 -0
- data/vendor/lua/lib/lua/metalua.lua +0 -0
- data/vendor/lua/lib/lua/metalua/ast_to_string.mlua +553 -0
- data/vendor/lua/lib/lua/metalua/base.lua +104 -0
- data/vendor/lua/lib/lua/metalua/bytecode.lua +0 -0
- data/vendor/lua/lib/lua/metalua/clopts.mlua +204 -0
- data/vendor/lua/lib/lua/metalua/compiler.lua +3 -0
- data/vendor/lua/lib/lua/metalua/dollar.mlua +24 -0
- data/vendor/lua/lib/lua/metalua/extension/H-runtime.mlua +216 -0
- data/vendor/lua/lib/lua/metalua/extension/H.mlua +22 -0
- data/vendor/lua/lib/lua/metalua/extension/anaphoric.mlua +54 -0
- data/vendor/lua/lib/lua/metalua/extension/clist.mlua +149 -0
- data/vendor/lua/lib/lua/metalua/extension/continue.mlua +53 -0
- data/vendor/lua/lib/lua/metalua/extension/localin.mlua +2 -0
- data/vendor/lua/lib/lua/metalua/extension/log.mlua +39 -0
- data/vendor/lua/lib/lua/metalua/extension/match.mlua +374 -0
- data/vendor/lua/lib/lua/metalua/extension/ternary.mlua +10 -0
- data/vendor/lua/lib/lua/metalua/extension/trycatch.mlua +189 -0
- data/vendor/lua/lib/lua/metalua/extension/types-runtime.mlua +159 -0
- data/vendor/lua/lib/lua/metalua/extension/types.mlua +352 -0
- data/vendor/lua/lib/lua/metalua/extension/withdo.mlua +30 -0
- data/vendor/lua/lib/lua/metalua/extension/xglobal-runtime.lua +41 -0
- data/vendor/lua/lib/lua/metalua/extension/xglobal.mlua +20 -0
- data/vendor/lua/lib/lua/metalua/extension/xloop.mlua +100 -0
- data/vendor/lua/lib/lua/metalua/extension/xmatch.mlua +216 -0
- data/vendor/lua/lib/lua/metalua/metaloop.mlua +76 -0
- data/vendor/lua/lib/lua/metalua/mlc.lua +0 -0
- data/vendor/lua/lib/lua/metalua/mlc_xcall.lua +119 -0
- data/vendor/lua/lib/lua/metalua/mlp.lua +0 -0
- data/vendor/lua/lib/lua/metalua/package2.lua +101 -0
- data/vendor/lua/lib/lua/metalua/runtime.lua +3 -0
- data/vendor/lua/lib/lua/metalua/string2.lua +44 -0
- data/vendor/lua/lib/lua/metalua/table2.lua +372 -0
- data/vendor/lua/lib/lua/metalua/walk.mlua +304 -0
- data/vendor/lua/lib/lua/metalua/walk/bindings.mlua +41 -0
- data/vendor/lua/lib/lua/metalua/walk/id.mlua +186 -0
- data/vendor/lua/lib/lua/metalua/walk/scope.lua +54 -0
- data/vendor/lua/lib/lua/mime.lua +87 -0
- data/vendor/lua/lib/lua/mime/core.dll +0 -0
- data/vendor/lua/lib/lua/mobdebug.lua +1484 -0
- data/vendor/lua/lib/lua/modules.lua +16 -0
- data/vendor/lua/lib/lua/object.lua +56 -0
- data/vendor/lua/lib/lua/oil/Exception.lua +26 -0
- data/vendor/lua/lib/lua/oil/arch.lua +27 -0
- data/vendor/lua/lib/lua/oil/arch/basic/client.lua +29 -0
- data/vendor/lua/lib/lua/oil/arch/basic/common.lua +13 -0
- data/vendor/lua/lib/lua/oil/arch/basic/server.lua +27 -0
- data/vendor/lua/lib/lua/oil/arch/cooperative/common.lua +10 -0
- data/vendor/lua/lib/lua/oil/arch/cooperative/server.lua +16 -0
- data/vendor/lua/lib/lua/oil/arch/corba/client.lua +39 -0
- data/vendor/lua/lib/lua/oil/arch/corba/common.lua +58 -0
- data/vendor/lua/lib/lua/oil/arch/corba/intercepted/client.lua +9 -0
- data/vendor/lua/lib/lua/oil/arch/corba/intercepted/server.lua +9 -0
- data/vendor/lua/lib/lua/oil/arch/corba/server.lua +35 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/byref.lua +18 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/client.lua +19 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/common.lua +18 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/server.lua +19 -0
- data/vendor/lua/lib/lua/oil/arch/typed/client.lua +27 -0
- data/vendor/lua/lib/lua/oil/arch/typed/common.lua +9 -0
- data/vendor/lua/lib/lua/oil/arch/typed/server.lua +18 -0
- data/vendor/lua/lib/lua/oil/assert.lua +87 -0
- data/vendor/lua/lib/lua/oil/builder.lua +45 -0
- data/vendor/lua/lib/lua/oil/builder/basic/client.lua +31 -0
- data/vendor/lua/lib/lua/oil/builder/basic/common.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/basic/server.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/cooperative/common.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/cooperative/server.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/corba/client.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/corba/common.lua +24 -0
- data/vendor/lua/lib/lua/oil/builder/corba/gencode.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/corba/intercepted/client.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/corba/intercepted/server.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/corba/server.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/lua/client.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/lua/server.lua +12 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/byref.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/client.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/common.lua +14 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/server.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/typed/client.lua +16 -0
- data/vendor/lua/lib/lua/oil/builder/typed/server.lua +12 -0
- data/vendor/lua/lib/lua/oil/compat.lua +846 -0
- data/vendor/lua/lib/lua/oil/component.lua +1 -0
- data/vendor/lua/lib/lua/oil/corba/giop.lua +301 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Codec.lua +1568 -0
- data/vendor/lua/lib/lua/oil/corba/giop/CodecGen.lua +589 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Exception.lua +25 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Indexer.lua +63 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Listener.lua +343 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Messenger.lua +228 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Referrer.lua +180 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Requester.lua +462 -0
- data/vendor/lua/lib/lua/oil/corba/idl.lua +597 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Compiler.lua +133 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Importer.lua +235 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Indexer.lua +95 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Registry.lua +1821 -0
- data/vendor/lua/lib/lua/oil/corba/idl/ir.lua +847 -0
- data/vendor/lua/lib/lua/oil/corba/idl/sysex.lua +21 -0
- data/vendor/lua/lib/lua/oil/corba/iiop/Profiler.lua +200 -0
- data/vendor/lua/lib/lua/oil/corba/intercepted/Listener.lua +158 -0
- data/vendor/lua/lib/lua/oil/corba/intercepted/Requester.lua +181 -0
- data/vendor/lua/lib/lua/oil/corba/services/event.lua +126 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/ConsumerAdmin.lua +50 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/EventFactory.lua +15 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/EventQueue.lua +37 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/ProxyPushConsumer.lua +75 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/ProxyPushSupplier.lua +62 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/SingleDeferredDispatcher.lua +60 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/SingleSynchronousDispatcher.lua +39 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/SupplierAdmin.lua +50 -0
- data/vendor/lua/lib/lua/oil/corba/services/naming.lua +436 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Acceptor.lua +268 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Channels.lua +121 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Connector.lua +147 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Dispatcher.lua +99 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies.lua +86 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/asynchronous.lua +56 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/protected.lua +17 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/synchronous.lua +17 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/utils.lua +29 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Receiver.lua +110 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Servants.lua +207 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Sockets.lua +44 -0
- data/vendor/lua/lib/lua/oil/kernel/cooperative/Receiver.lua +139 -0
- data/vendor/lua/lib/lua/oil/kernel/intercepted/Listener.lua +47 -0
- data/vendor/lua/lib/lua/oil/kernel/intercepted/Requester.lua +58 -0
- data/vendor/lua/lib/lua/oil/kernel/lua/Dispatcher.lua +76 -0
- data/vendor/lua/lib/lua/oil/kernel/lua/Proxies.lua +69 -0
- data/vendor/lua/lib/lua/oil/kernel/typed/Dispatcher.lua +91 -0
- data/vendor/lua/lib/lua/oil/kernel/typed/Proxies.lua +153 -0
- data/vendor/lua/lib/lua/oil/kernel/typed/Servants.lua +137 -0
- data/vendor/lua/lib/lua/oil/ludo/Codec.lua +66 -0
- data/vendor/lua/lib/lua/oil/ludo/CodecByRef.lua +103 -0
- data/vendor/lua/lib/lua/oil/ludo/Listener.lua +151 -0
- data/vendor/lua/lib/lua/oil/ludo/Referrer.lua +72 -0
- data/vendor/lua/lib/lua/oil/ludo/Requester.lua +107 -0
- data/vendor/lua/lib/lua/oil/oo.lua +1 -0
- data/vendor/lua/lib/lua/oil/port.lua +1 -0
- data/vendor/lua/lib/lua/oil/properties.lua +57 -0
- data/vendor/lua/lib/lua/oil/verbose.lua +133 -0
- data/vendor/lua/lib/lua/package_ext.lua +15 -0
- data/vendor/lua/lib/lua/parser.lua +268 -0
- data/vendor/lua/lib/lua/pl/Date.lua +555 -0
- data/vendor/lua/lib/lua/pl/List.lua +613 -0
- data/vendor/lua/lib/lua/pl/Map.lua +113 -0
- data/vendor/lua/lib/lua/pl/MultiMap.lua +62 -0
- data/vendor/lua/lib/lua/pl/OrderedMap.lua +151 -0
- data/vendor/lua/lib/lua/pl/Set.lua +153 -0
- data/vendor/lua/lib/lua/pl/app.lua +165 -0
- data/vendor/lua/lib/lua/pl/array2d.lua +501 -0
- data/vendor/lua/lib/lua/pl/class.lua +180 -0
- data/vendor/lua/lib/lua/pl/comprehension.lua +286 -0
- data/vendor/lua/lib/lua/pl/config.lua +176 -0
- data/vendor/lua/lib/lua/pl/data.lua +606 -0
- data/vendor/lua/lib/lua/pl/dir.lua +475 -0
- data/vendor/lua/lib/lua/pl/file.lua +70 -0
- data/vendor/lua/lib/lua/pl/func.lua +376 -0
- data/vendor/lua/lib/lua/pl/init.lua +68 -0
- data/vendor/lua/lib/lua/pl/input.lua +173 -0
- data/vendor/lua/lib/lua/pl/lapp.lua +407 -0
- data/vendor/lua/lib/lua/pl/lexer.lua +456 -0
- data/vendor/lua/lib/lua/pl/luabalanced.lua +264 -0
- data/vendor/lua/lib/lua/pl/operator.lua +201 -0
- data/vendor/lua/lib/lua/pl/path.lua +398 -0
- data/vendor/lua/lib/lua/pl/permute.lua +63 -0
- data/vendor/lua/lib/lua/pl/platf/luajava.lua +101 -0
- data/vendor/lua/lib/lua/pl/pretty.lua +285 -0
- data/vendor/lua/lib/lua/pl/seq.lua +551 -0
- data/vendor/lua/lib/lua/pl/sip.lua +344 -0
- data/vendor/lua/lib/lua/pl/strict.lua +70 -0
- data/vendor/lua/lib/lua/pl/stringio.lua +158 -0
- data/vendor/lua/lib/lua/pl/stringx.lua +440 -0
- data/vendor/lua/lib/lua/pl/tablex.lua +817 -0
- data/vendor/lua/lib/lua/pl/template.lua +103 -0
- data/vendor/lua/lib/lua/pl/test.lua +135 -0
- data/vendor/lua/lib/lua/pl/text.lua +243 -0
- data/vendor/lua/lib/lua/pl/utils.lua +550 -0
- data/vendor/lua/lib/lua/pl/xml.lua +689 -0
- data/vendor/lua/lib/lua/profiler.dll +0 -0
- data/vendor/lua/lib/lua/re.lua +248 -0
- data/vendor/lua/lib/lua/rex_onig.dll +0 -0
- data/vendor/lua/lib/lua/rex_pcre.dll +0 -0
- data/vendor/lua/lib/lua/rex_posix.dll +0 -0
- data/vendor/lua/lib/lua/rings.dll +0 -0
- data/vendor/lua/lib/lua/serialize.lua +193 -0
- data/vendor/lua/lib/lua/set.lua +149 -0
- data/vendor/lua/lib/lua/socket.lua +133 -0
- data/vendor/lua/lib/lua/socket/core.dll +0 -0
- data/vendor/lua/lib/lua/socket/ftp.lua +281 -0
- data/vendor/lua/lib/lua/socket/http.lua +350 -0
- data/vendor/lua/lib/lua/socket/smtp.lua +251 -0
- data/vendor/lua/lib/lua/socket/tp.lua +123 -0
- data/vendor/lua/lib/lua/socket/url.lua +297 -0
- data/vendor/lua/lib/lua/ssl.dll +0 -0
- data/vendor/lua/lib/lua/ssl.lua +93 -0
- data/vendor/lua/lib/lua/ssl/https.lua +138 -0
- data/vendor/lua/lib/lua/stable.lua +28 -0
- data/vendor/lua/lib/lua/std.lua +16 -0
- data/vendor/lua/lib/lua/strbuf.lua +32 -0
- data/vendor/lua/lib/lua/strict.lua +45 -0
- data/vendor/lua/lib/lua/string_ext.lua +274 -0
- data/vendor/lua/lib/lua/table_ext.lua +117 -0
- data/vendor/lua/lib/lua/tar.lua +262 -0
- data/vendor/lua/lib/lua/task.dll +0 -0
- data/vendor/lua/lib/lua/tree.lua +81 -0
- data/vendor/lua/lib/lua/unicode.dll +0 -0
- data/vendor/lua/lib/lua/verbose_require.lua +11 -0
- data/vendor/lua/lib/lua/vstruct.lua +86 -0
- data/vendor/lua/lib/lua/vstruct/ast.lua +192 -0
- data/vendor/lua/lib/lua/vstruct/ast/Bitpack.lua +33 -0
- data/vendor/lua/lib/lua/vstruct/ast/Generator.lua +174 -0
- data/vendor/lua/lib/lua/vstruct/ast/IO.lua +45 -0
- data/vendor/lua/lib/lua/vstruct/ast/List.lua +56 -0
- data/vendor/lua/lib/lua/vstruct/ast/Name.lua +20 -0
- data/vendor/lua/lib/lua/vstruct/ast/Repeat.lua +23 -0
- data/vendor/lua/lib/lua/vstruct/ast/Root.lua +19 -0
- data/vendor/lua/lib/lua/vstruct/ast/Table.lua +65 -0
- data/vendor/lua/lib/lua/vstruct/cursor.lua +81 -0
- data/vendor/lua/lib/lua/vstruct/io.lua +45 -0
- data/vendor/lua/lib/lua/vstruct/io/a.lua +24 -0
- data/vendor/lua/lib/lua/vstruct/io/b.lua +28 -0
- data/vendor/lua/lib/lua/vstruct/io/bigendian.lua +21 -0
- data/vendor/lua/lib/lua/vstruct/io/c.lua +25 -0
- data/vendor/lua/lib/lua/vstruct/io/defaults.lua +24 -0
- data/vendor/lua/lib/lua/vstruct/io/endianness.lua +41 -0
- data/vendor/lua/lib/lua/vstruct/io/f.lua +129 -0
- data/vendor/lua/lib/lua/vstruct/io/hostendian.lua +21 -0
- data/vendor/lua/lib/lua/vstruct/io/i.lua +42 -0
- data/vendor/lua/lib/lua/vstruct/io/littleendian.lua +21 -0
- data/vendor/lua/lib/lua/vstruct/io/m.lua +62 -0
- data/vendor/lua/lib/lua/vstruct/io/p.lua +23 -0
- data/vendor/lua/lib/lua/vstruct/io/s.lua +27 -0
- data/vendor/lua/lib/lua/vstruct/io/seekb.lua +18 -0
- data/vendor/lua/lib/lua/vstruct/io/seekf.lua +18 -0
- data/vendor/lua/lib/lua/vstruct/io/seekto.lua +18 -0
- data/vendor/lua/lib/lua/vstruct/io/u.lua +54 -0
- data/vendor/lua/lib/lua/vstruct/io/x.lua +34 -0
- data/vendor/lua/lib/lua/vstruct/io/z.lua +63 -0
- data/vendor/lua/lib/lua/vstruct/lexer.lua +100 -0
- data/vendor/lua/lib/lua/vstruct/pack.lua +142 -0
- data/vendor/lua/lib/lua/vstruct/test.lua +47 -0
- data/vendor/lua/lib/lua/vstruct/test/basic.lua +73 -0
- data/vendor/lua/lib/lua/vstruct/test/common.lua +100 -0
- data/vendor/lua/lib/lua/vstruct/test/fp-bigendian.lua +56 -0
- data/vendor/lua/lib/lua/vstruct/test/fp-littleendian.lua +56 -0
- data/vendor/lua/lib/lua/vstruct/test/struct-test-gen.lua +1230 -0
- data/vendor/lua/lib/lua/vstruct/unpack.lua +126 -0
- data/vendor/lua/lib/lua/wx.dll +0 -0
- data/vendor/lua/lib/lua/xml.lua +75 -0
- data/vendor/lua/lib/lua/zip.dll +0 -0
- data/vendor/lua/lib/lua/zlib.dll +0 -0
- metadata +529 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
local require = require
|
2
|
+
local builder = require "oil.builder"
|
3
|
+
local arch = require "oil.arch.ludo.common"
|
4
|
+
|
5
|
+
module "oil.builder.ludo.common"
|
6
|
+
|
7
|
+
LuaEncoder = arch.ValueEncoder {require "oil.ludo.Codec" }
|
8
|
+
ObjectReferrer = arch.ObjectReferrer{require "oil.ludo.Referrer"}
|
9
|
+
|
10
|
+
function create(comps)
|
11
|
+
comps = builder.create(_M, comps)
|
12
|
+
comps.ValueEncoder = comps.LuaEncoder
|
13
|
+
return comps
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
local require = require
|
2
|
+
local builder = require "oil.builder"
|
3
|
+
local base = require "oil.arch.basic.common"
|
4
|
+
local arch = require "oil.arch.ludo.server"
|
5
|
+
|
6
|
+
module "oil.builder.ludo.server"
|
7
|
+
|
8
|
+
ServerChannels = base.SocketChannels {require "oil.kernel.base.Acceptor"}
|
9
|
+
RequestListener = arch.RequestListener{require "oil.ludo.Listener" }
|
10
|
+
|
11
|
+
function create(comps)
|
12
|
+
return builder.create(_M, comps)
|
13
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
local setfenv = setfenv
|
2
|
+
local require = require
|
3
|
+
local builder = require "oil.builder"
|
4
|
+
local arch = require "oil.arch.typed.client"
|
5
|
+
local basic = require "oil.builder.basic.client"
|
6
|
+
|
7
|
+
module "oil.builder.typed.client"
|
8
|
+
|
9
|
+
ProxyManager = arch.ProxyManager{require "oil.kernel.typed.Proxies"}
|
10
|
+
|
11
|
+
function create(comps)
|
12
|
+
setfenv(basic.create, _M)
|
13
|
+
comps = basic.create(comps)
|
14
|
+
setfenv(basic.create, basic)
|
15
|
+
return comps
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
local require = require
|
2
|
+
local builder = require "oil.builder"
|
3
|
+
local arch = require "oil.arch.typed.server"
|
4
|
+
|
5
|
+
module "oil.builder.typed.server"
|
6
|
+
|
7
|
+
ServantManager = arch.ServantManager{require "oil.kernel.typed.Servants" ,
|
8
|
+
dispatcher = require "oil.kernel.typed.Dispatcher"}
|
9
|
+
|
10
|
+
function create(comps)
|
11
|
+
return builder.create(_M, comps)
|
12
|
+
end
|
@@ -0,0 +1,846 @@
|
|
1
|
+
--------------------------------------------------------------------------------
|
2
|
+
------------------------------ ##### ## ------------------------------
|
3
|
+
------------------------------ ## ## # ## ------------------------------
|
4
|
+
------------------------------ ## ## ## ## ------------------------------
|
5
|
+
------------------------------ ## ## # ## ------------------------------
|
6
|
+
------------------------------ ##### ### ###### ------------------------------
|
7
|
+
-------------------------------- --------------------------------
|
8
|
+
----------------------- An Object Request Broker in Lua ------------------------
|
9
|
+
--------------------------------------------------------------------------------
|
10
|
+
-- Project: OiL - ORB in Lua: An Object Request Broker in Lua --
|
11
|
+
-- Release: 0.5 alpha --
|
12
|
+
-- Title : OiL main programming interface (API) --
|
13
|
+
-- Authors: Renato Maia <maia@inf.puc-rio.br> --
|
14
|
+
--------------------------------------------------------------------------------
|
15
|
+
-- Interface: --
|
16
|
+
-- VERSION --
|
17
|
+
-- --
|
18
|
+
-- assemble(flavor) --
|
19
|
+
-- --
|
20
|
+
-- types --
|
21
|
+
-- loadidl(code) --
|
22
|
+
-- loadidlfile(path) --
|
23
|
+
-- getLIR() --
|
24
|
+
-- getIR() --
|
25
|
+
-- setIR(ir) --
|
26
|
+
-- --
|
27
|
+
-- newproxy(objref, [iface]) --
|
28
|
+
-- narrow(proxy, [iface]) --
|
29
|
+
-- --
|
30
|
+
-- newservant(impl, [iface], [key]) --
|
31
|
+
-- deactivate(object, [type]) --
|
32
|
+
-- tostring(object) --
|
33
|
+
-- --
|
34
|
+
-- Config --
|
35
|
+
-- init() --
|
36
|
+
-- pending() --
|
37
|
+
-- step() --
|
38
|
+
-- run() --
|
39
|
+
-- shutdown() --
|
40
|
+
-- --
|
41
|
+
-- main(function) --
|
42
|
+
-- newthread(function, ...) --
|
43
|
+
-- pcall(function, ...) --
|
44
|
+
-- sleep(time) --
|
45
|
+
-- time() --
|
46
|
+
-- tasks --
|
47
|
+
-- --
|
48
|
+
-- newencoder() --
|
49
|
+
-- newdecoder(stream) --
|
50
|
+
-- --
|
51
|
+
-- newexcept(body) --
|
52
|
+
-- setexcatch(callback, [type]) --
|
53
|
+
-- --
|
54
|
+
-- setclientinterceptor([iceptor]) --
|
55
|
+
-- setserverinterceptor([iceptor]) --
|
56
|
+
-- --
|
57
|
+
-- createservant(impl, [iface], [key]) --
|
58
|
+
-- createproxy(objref, [iface]) --
|
59
|
+
-- --
|
60
|
+
-- writeto(filepath, text) --
|
61
|
+
-- readfrom(filepath) --
|
62
|
+
-- writeIOR(servant, filepath) --
|
63
|
+
-- readIOR(filepath) --
|
64
|
+
--------------------------------------------------------------------------------
|
65
|
+
-- Notes: --
|
66
|
+
--------------------------------------------------------------------------------
|
67
|
+
|
68
|
+
local module = module
|
69
|
+
local luapcall = pcall
|
70
|
+
local require = require
|
71
|
+
|
72
|
+
local io = require "io"
|
73
|
+
local coroutine = require "coroutine"
|
74
|
+
|
75
|
+
local builder = require "oil.builder"
|
76
|
+
local assert = require "oil.assert"
|
77
|
+
|
78
|
+
local OIL_FLAVOR = OIL_FLAVOR
|
79
|
+
|
80
|
+
--------------------------------------------------------------------------------
|
81
|
+
-- OiL main programming interface (API).
|
82
|
+
|
83
|
+
-- This API provides access to the basic functionalities of the OiL ORB.
|
84
|
+
-- More advanced features may be accessed through more specialized interfaces
|
85
|
+
-- provided by internal components. OiL internal component organization is meant
|
86
|
+
-- to be customized for the application.
|
87
|
+
|
88
|
+
module "oil"
|
89
|
+
|
90
|
+
VERSION = "OiL 0.5 beta"
|
91
|
+
|
92
|
+
--------------------------------------------------------------------------------
|
93
|
+
-- Creates and assembles OiL components to compose an ORB instance.
|
94
|
+
--
|
95
|
+
-- The 'flavor' parameter defines a list of archtectural levels.
|
96
|
+
-- Each level defines a set of components and connections that extends the
|
97
|
+
-- following level.
|
98
|
+
--
|
99
|
+
-- Components are created by builder modules registered under namespace
|
100
|
+
-- 'oil.builder.*' that must provide a 'create(components)' function.
|
101
|
+
-- The parameter 'components' is a table with all components created by the
|
102
|
+
-- previous levels builders and that must be used to store the components
|
103
|
+
-- created by the builder.
|
104
|
+
--
|
105
|
+
-- Components created by a previous builder should not be replaced by components
|
106
|
+
-- created by following builders.
|
107
|
+
-- After all level components are they are assembled by assembler modules
|
108
|
+
-- registered under namespace 'oil.arch.*' that must provide a
|
109
|
+
-- 'assemble(components)' function.
|
110
|
+
-- The parameter 'components' is a table with all components created by the
|
111
|
+
-- levels builders.
|
112
|
+
--
|
113
|
+
-- NOTE: A default assembly is created when the 'oil' package is first required
|
114
|
+
-- with levels "corba;typed;cooperative;base" or the one defined by global
|
115
|
+
-- variable 'OIL_FLAVOR'.
|
116
|
+
--
|
117
|
+
-- @param flavor string Semi-colom separated list of component archtectures.
|
118
|
+
-- @param [comps] table Table where assembled components must be stored.
|
119
|
+
-- @return table Table with assembled components.
|
120
|
+
--
|
121
|
+
-- @usage comps = assemble("corba;typed;cooperative;base") .
|
122
|
+
-- @usage comps = assemble("corba;typed;base") .
|
123
|
+
-- @usage comps = assemble("ludo;cooperative;base") .
|
124
|
+
--
|
125
|
+
function assemble(flavor, comps)
|
126
|
+
assert.type(flavor, "string", "OiL flavor name")
|
127
|
+
return builder.build(flavor, comps)
|
128
|
+
end
|
129
|
+
|
130
|
+
assemble(OIL_FLAVOR or "corba;typed;cooperative;base", _M)
|
131
|
+
-- UNCOMMENT THIS LINE FOR COMPATIBILITY WITH VERSION 0.3
|
132
|
+
--assemble(OIL_FLAVOR or "corba;typed;base", _M)
|
133
|
+
|
134
|
+
--------------------------------------------------------------------------------
|
135
|
+
-- Internal interface repository used by the ORB.
|
136
|
+
--
|
137
|
+
-- This is a alias for a facet of the Type Respository component of the internal
|
138
|
+
-- architecture.
|
139
|
+
-- If the current assembly does not provide this component, this field is 'nil'.
|
140
|
+
--
|
141
|
+
-- @usage oil.types:register(oil.corba.idl.sequence{oil.corba.idl.string}) .
|
142
|
+
-- @usage oil.types:lookup("CORBA::StructDescription") .
|
143
|
+
-- @usage oil.types:lookup_id("IDL:omg.org/CORBA/InterfaceDef:1.0") .
|
144
|
+
--
|
145
|
+
types = TypeRepository and TypeRepository.types
|
146
|
+
|
147
|
+
--------------------------------------------------------------------------------
|
148
|
+
-- Loads an IDL code strip into the internal interface repository.
|
149
|
+
--
|
150
|
+
-- The IDL specified will be parsed by the LuaIDL compiler and the resulting
|
151
|
+
-- definitions are updated in the internal interface repository.
|
152
|
+
-- If any errors occurs during the parse no definitions are loaded into the IR.
|
153
|
+
--
|
154
|
+
-- @param idlspec string The IDL code strip to be loaded into the local IR.
|
155
|
+
-- @return ... object IDL descriptors that represents the loaded definitions.
|
156
|
+
--
|
157
|
+
-- @usage oil.loadidl [[
|
158
|
+
-- interface Hello {
|
159
|
+
-- attribute boolean quiet;
|
160
|
+
-- readonly attribute unsigned long count;
|
161
|
+
-- string say_hello_to(in string msg);
|
162
|
+
-- };
|
163
|
+
-- ]] .
|
164
|
+
--
|
165
|
+
function loadidl(idlspec)
|
166
|
+
assert.type(idlspec, "string", "IDL specification")
|
167
|
+
return assert.results(TypeRepository.compiler:load(idlspec))
|
168
|
+
end
|
169
|
+
|
170
|
+
--------------------------------------------------------------------------------
|
171
|
+
-- Loads an IDL file into the internal interface repository.
|
172
|
+
--
|
173
|
+
-- The file specified will be parsed by the LuaIDL compiler and the resulting
|
174
|
+
-- definitions are updated in the internal interface repository.
|
175
|
+
-- If any errors occurs during the parse no definitions are loaded into the IR.
|
176
|
+
--
|
177
|
+
-- @param filename string The path to the IDL file that must be loaded.
|
178
|
+
-- @return ... object IDL descriptors that represents the loaded definitions.
|
179
|
+
--
|
180
|
+
-- @usage oil.loadidlfile "/usr/local/corba/idl/CosNaming.idl" .
|
181
|
+
-- @usage oil.loadidlfile("HelloWorld.idl", "/tmp/preprocessed.idl") .
|
182
|
+
--
|
183
|
+
function loadidlfile(filepath)
|
184
|
+
assert.type(filepath, "string", "IDL file path")
|
185
|
+
return assert.results(TypeRepository.compiler:loadfile(filepath))
|
186
|
+
end
|
187
|
+
|
188
|
+
--------------------------------------------------------------------------------
|
189
|
+
-- Get the servant of the internal interface repository.
|
190
|
+
--
|
191
|
+
-- Function used to retrieve a reference to the integrated Interface Repository.
|
192
|
+
-- It returns a reference to the object that implements the internal Interface
|
193
|
+
-- Repository and exports local cached interface definitions.
|
194
|
+
--
|
195
|
+
-- @return proxy CORBA object that exports the local interface repository.
|
196
|
+
--
|
197
|
+
-- @usage oil.writeto("ir.ior", oil.tostring(oil.getLIR())) .
|
198
|
+
--
|
199
|
+
function getLIR()
|
200
|
+
return newservant(TypeRepository.types,
|
201
|
+
"IDL:omg.org/CORBA/Repository:1.0",
|
202
|
+
"InterfaceRepository")
|
203
|
+
end
|
204
|
+
|
205
|
+
--------------------------------------------------------------------------------
|
206
|
+
-- Get the remote interface repository used to retrieve interface definitions.
|
207
|
+
--
|
208
|
+
-- Function used to set the remote Interface Repository that must be used to
|
209
|
+
-- retrieve interface definitions not stored in the internal IR.
|
210
|
+
-- Once these definitions are acquired, they are stored in the internal IR.
|
211
|
+
--
|
212
|
+
-- @return proxy Proxy for the remote IR currently used.
|
213
|
+
--
|
214
|
+
function getIR()
|
215
|
+
return TypeRepository.delegated
|
216
|
+
end
|
217
|
+
|
218
|
+
--------------------------------------------------------------------------------
|
219
|
+
-- Defines a remote interface repository used to retrieve interface definitions.
|
220
|
+
--
|
221
|
+
-- Function used to get a reference to the Interface Repository used to retrieve
|
222
|
+
-- interface definitions not stored in the internal IR.
|
223
|
+
--
|
224
|
+
-- @param ir proxy Proxy for the remote IR to be used.
|
225
|
+
--
|
226
|
+
-- @usage oil.setIR(oil.newproxy("corbaloc::cos_host/InterfaceRepository",
|
227
|
+
-- "IDL:omg.org/CORBA/Repository:1.0")) .
|
228
|
+
--
|
229
|
+
function setIR(ir)
|
230
|
+
TypeRepository.delegated = ir
|
231
|
+
end
|
232
|
+
|
233
|
+
--------------------------------------------------------------------------------
|
234
|
+
-- Creates a proxy for a remote object defined by a textual reference.
|
235
|
+
--
|
236
|
+
-- The value of reference must be a string containing reference information of
|
237
|
+
-- the object the new new proxy will represent like a stringfied IOR
|
238
|
+
-- (Inter-operable Object Reference) or corbaloc.
|
239
|
+
-- Optionally, an interface supported by the remote object may be defined, in
|
240
|
+
-- this case no attempt is made to determine the actual object interface, i.e.
|
241
|
+
-- no network communication is made to check the object's interface.
|
242
|
+
--
|
243
|
+
-- @param object string Textual representation of object's reference the new
|
244
|
+
-- proxy will represent.
|
245
|
+
-- @param interface string [optional] Interface identification in the interface
|
246
|
+
-- repository, like a repID or absolute name of a interface the remote object
|
247
|
+
-- supports (no interface or type check is done).
|
248
|
+
--
|
249
|
+
-- @return table Proxy to the remote object.
|
250
|
+
--
|
251
|
+
-- @usage oil.newproxy("IOR:00000002B494...") .
|
252
|
+
-- @usage oil.newproxy("IOR:00000002B494...", "HelloWorld::Hello") .
|
253
|
+
-- @usage oil.newproxy("IOR:00000002B494...", "IDL:HelloWorld/Hello:1.0") .
|
254
|
+
-- @usage oil.newproxy("corbaloc::host:8080/Key", "IDL:HelloWorld/Hello:1.0") .
|
255
|
+
--
|
256
|
+
function newproxy(object, type)
|
257
|
+
if Config then init(Config) end
|
258
|
+
assert.type(object, "string", "object reference")
|
259
|
+
return assert.results(ProxyManager.proxies:fromstring(object, type))
|
260
|
+
end
|
261
|
+
|
262
|
+
--------------------------------------------------------------------------------
|
263
|
+
-- Narrow an object reference into some more specific interface supported by the
|
264
|
+
-- remote object.
|
265
|
+
--
|
266
|
+
-- The object's reference is defined as a proxy object.
|
267
|
+
-- If you wish to create a proxy to an object specified by a textual reference
|
268
|
+
-- like an IOR (Inter-operable Object Reference) that is already narrowed into
|
269
|
+
-- function.
|
270
|
+
-- The interface the object reference must be narrowed into is defined by the
|
271
|
+
-- parameter 'interface' (e.g. an interface repository ID).
|
272
|
+
-- If no interface is defined, then the object reference is narrowed to the most
|
273
|
+
-- specific interface supported by the remote object.
|
274
|
+
-- Note that in the former case, no attempt is made to determine the actual
|
275
|
+
-- object interface, i.e. no network communication is made to check the object's
|
276
|
+
-- interface.
|
277
|
+
--
|
278
|
+
-- @param proxy table Proxy that represents the remote object which reference
|
279
|
+
-- must be narrowed.
|
280
|
+
-- @param interface string [optional] Identification of the interface the
|
281
|
+
-- object reference must be narrowed into (no interface or type check is
|
282
|
+
-- made).
|
283
|
+
--
|
284
|
+
-- @return table New proxy to the remote object narrowed into some interface
|
285
|
+
-- supported by the object.
|
286
|
+
--
|
287
|
+
-- @usage oil.narrow(ns:resolve_str("HelloWorld")) .
|
288
|
+
-- @usage oil.narrow(ns:resolve_str("HelloWorld"), "IDL:HelloWorld/Hello:1.0") .
|
289
|
+
--
|
290
|
+
-- @see newproxy
|
291
|
+
--
|
292
|
+
function narrow(object, type)
|
293
|
+
assert.type(object, "table", "object proxy")
|
294
|
+
if type then assert.type(type, "string", "interface definition") end
|
295
|
+
return object and object:_narrow(type)
|
296
|
+
end
|
297
|
+
|
298
|
+
--------------------------------------------------------------------------------
|
299
|
+
-- Creates a new servant implemented in Lua that supports some interface.
|
300
|
+
--
|
301
|
+
-- Function used to create a new servant from a table containing attribute
|
302
|
+
-- values and operation implementations.
|
303
|
+
-- The value of impl is used as the implementation of the a servant with
|
304
|
+
-- interface defined by parameter interface (e.g. repository ID or absolute
|
305
|
+
-- name of a given IDL interface stored in the IR).
|
306
|
+
-- Optionally, an object key value may be specified to create persistent
|
307
|
+
-- references.
|
308
|
+
-- The servant returned by this function offers all servant attributes and
|
309
|
+
-- methods, as well as implicit basic operations like CORBA's _interface or
|
310
|
+
-- _is_a.
|
311
|
+
-- After this call any requests which object key matches the key of the servant
|
312
|
+
-- are dispathed to its implementation.
|
313
|
+
--
|
314
|
+
-- @param object table Value used as the servant implementation (may be any
|
315
|
+
-- indexable value, e.g. userdata with a metatable that defined the __index
|
316
|
+
-- field).
|
317
|
+
-- @param interface string Interface identification line an absolute name of the
|
318
|
+
-- interface in the internal interface repository.
|
319
|
+
-- @param key string [optional] User-defined object key used in creation of the
|
320
|
+
-- object reference.
|
321
|
+
--
|
322
|
+
-- @return table servant created.
|
323
|
+
--
|
324
|
+
-- @usage oil.newservant({say_hello_to=print},"IDL:HelloWorld/Hello:1.0") .
|
325
|
+
-- @usage oil.newservant({say_hello_to=print},"::HelloWorld::Hello") .
|
326
|
+
-- @usage oil.newservant({say_hello_to=print},"::HelloWorld::Hello", "Key") .
|
327
|
+
--
|
328
|
+
function newservant(impl, type, key)
|
329
|
+
if Config then init(Config) end
|
330
|
+
if not impl then assert.illegal(impl, "servant's implementation") end
|
331
|
+
if type then assert.type(type, "string", "interface definition") end
|
332
|
+
if key then assert.type(key, "string", "servant's key") end
|
333
|
+
return assert.results(ServantManager.servants:register(impl, key, type))
|
334
|
+
end
|
335
|
+
|
336
|
+
--------------------------------------------------------------------------------
|
337
|
+
-- Deactivates a servant by removing its implementation from the object map.
|
338
|
+
--
|
339
|
+
-- If 'object' is a servant (i.e. the object returned by 'newservant') then it
|
340
|
+
-- is deactivated.
|
341
|
+
-- Alternatively, the 'object' parameter may be the servant's object key.
|
342
|
+
-- Only in the case that the servant was created with an implicitly created key
|
343
|
+
-- by the ORB then the 'object' can be the servant's implementation.
|
344
|
+
-- Since a single implementation object can be used to create many servants with
|
345
|
+
-- different interface, in this case the 'type' parameter must be provided with
|
346
|
+
-- the exact servant's interface.
|
347
|
+
--
|
348
|
+
-- @param object string|object Servant's object key, servant's implementation or
|
349
|
+
-- servant itself.
|
350
|
+
-- @param type string Identification of the servant's interface (e.g. repository
|
351
|
+
-- ID or absolute name).
|
352
|
+
--
|
353
|
+
-- @usage oil.deactivate(oil.newservant(impl, "::MyInterface", "objkey")) .
|
354
|
+
-- @usage oil.deactivate("objkey") .
|
355
|
+
-- @usage oil.deactivate(impl, "MyInterface") .
|
356
|
+
--
|
357
|
+
function deactivate(object, type)
|
358
|
+
if not object then
|
359
|
+
assert.illegal(object,
|
360
|
+
"object reference (servant, implementation or object key expected)")
|
361
|
+
end
|
362
|
+
return ServantManager.servants:remove(object, type)
|
363
|
+
end
|
364
|
+
|
365
|
+
--------------------------------------------------------------------------------
|
366
|
+
-- Returns textual information that identifies the servant.
|
367
|
+
--
|
368
|
+
-- This function is used to get textual information that references a servant
|
369
|
+
-- or proxy like an IOR (Inter-operable Object Reference).
|
370
|
+
--
|
371
|
+
-- @param servant object Servant which textual referecence must be taken.
|
372
|
+
--
|
373
|
+
-- @return string Textual referecence to the servant.
|
374
|
+
--
|
375
|
+
-- @usage oil.writeto("ref.ior", oil.tostring(oil.newservant(impl, "::Hello"))).
|
376
|
+
--
|
377
|
+
function tostring(object)
|
378
|
+
assert.type(object, "table", "servant object")
|
379
|
+
return assert.results(ServantManager.servants:tostring(object))
|
380
|
+
end
|
381
|
+
|
382
|
+
--------------------------------------------------------------------------------
|
383
|
+
-- Default configuration for creation of the default ORB instance.
|
384
|
+
--
|
385
|
+
-- The configuration values may differ accordingly to the underlying protocol.
|
386
|
+
-- For Internet IOP (IIOP) protocol the current options are the host name or IP
|
387
|
+
-- address and port that ORB must bind to, as well as the host name or IP
|
388
|
+
-- address and port that must be used in creation of object references.
|
389
|
+
--
|
390
|
+
-- @field tag number Tag of the IOP protocol the ORB shall use. The default is
|
391
|
+
-- 0, that indicates the Internet IOP (IIOP).
|
392
|
+
-- @field host string Host name or IP address. If none is provided the ORB binds
|
393
|
+
-- to all current net interfaces.
|
394
|
+
-- @field port number Port the ORB must listen. If none is provided, the ORB
|
395
|
+
-- tries to bind to a port in the range [2809; 9999].
|
396
|
+
-- @field refhost string Host name or IP address informed in object references.
|
397
|
+
-- @field refport number Port informed in object references.
|
398
|
+
--
|
399
|
+
-- @usage oil.Config.host = "middleware.inf.puc-rio.br" .
|
400
|
+
-- @usage oil.Config.host = "10.223.10.56" .
|
401
|
+
-- @usage oil.Config.port = 8080 .
|
402
|
+
-- @usage oil.Config = {host = "10.223.10.56", port = 8080 } .
|
403
|
+
--
|
404
|
+
-- @see init
|
405
|
+
--
|
406
|
+
Config = {}
|
407
|
+
|
408
|
+
--------------------------------------------------------------------------------
|
409
|
+
-- Initialize the OiL main ORB.
|
410
|
+
--
|
411
|
+
-- Initialize the default ORB instance with the provided configurations like
|
412
|
+
-- described in 'Config'.
|
413
|
+
-- If the default ORB already is created then this instance is returned.
|
414
|
+
-- This default ORB is used by all objects and proxies created by newservant and
|
415
|
+
-- newproxy functions.
|
416
|
+
--
|
417
|
+
-- @param config table Configuration used to create the default ORB instance.
|
418
|
+
-- @return table Configuration values actually used by the ORB instance.
|
419
|
+
--
|
420
|
+
-- @usage oil.init() .
|
421
|
+
-- @usage oil.init{ host = "middleware.inf.puc-rio.br" } .
|
422
|
+
-- @usage oil.init{ host = "10.223.10.56", port = 8080 } .
|
423
|
+
--
|
424
|
+
-- @see Config
|
425
|
+
--
|
426
|
+
function init(config)
|
427
|
+
config, Config = config or Config, nil
|
428
|
+
assert.type(config, "table", "ORB configuration")
|
429
|
+
return assert.results(self.RequestReceiver.acceptor:initialize(config))
|
430
|
+
end
|
431
|
+
|
432
|
+
--------------------------------------------------------------------------------
|
433
|
+
-- Checks whether there is some request pending
|
434
|
+
--
|
435
|
+
-- Function used to checks whether there is some unprocessed ORB request
|
436
|
+
-- pending.
|
437
|
+
-- It returns true if there is some request pending that must be processed by
|
438
|
+
-- the main ORB or false otherwise.
|
439
|
+
--
|
440
|
+
-- @return boolean True if there is some ORB request pending or false otherwise.
|
441
|
+
--
|
442
|
+
-- @usage while oil.pending() do oil.step() end .
|
443
|
+
--
|
444
|
+
function pending()
|
445
|
+
return assert.results(RequestReceiver.acceptor:hasrequest())
|
446
|
+
end
|
447
|
+
|
448
|
+
--------------------------------------------------------------------------------
|
449
|
+
-- Waits for an ORB request and process it.
|
450
|
+
--
|
451
|
+
-- Function used to wait for an ORB request and process it.
|
452
|
+
-- Only one single ORB request is processed at each call.
|
453
|
+
-- It returns true if no exception is raised during request processing, or 'nil'
|
454
|
+
-- and the raised exception otherwise.
|
455
|
+
--
|
456
|
+
-- @usage while oil.pending() do oil.step() end .
|
457
|
+
--
|
458
|
+
function step()
|
459
|
+
return assert.results(RequestReceiver.acceptor:acceptone())
|
460
|
+
end
|
461
|
+
|
462
|
+
--------------------------------------------------------------------------------
|
463
|
+
-- Runs the ORB main loop.
|
464
|
+
--
|
465
|
+
-- Function used to process all remote requisitions continuously until some
|
466
|
+
-- exception is raised.
|
467
|
+
-- If an exception is raised during the processing of requests this function
|
468
|
+
-- returns nil and the raised exception.
|
469
|
+
-- This function implicitly initiates the ORB if it was not initialized yet.
|
470
|
+
--
|
471
|
+
-- @see init
|
472
|
+
--
|
473
|
+
function run()
|
474
|
+
if Config then init(Config) end
|
475
|
+
return assert.results(RequestReceiver.acceptor:acceptall())
|
476
|
+
end
|
477
|
+
|
478
|
+
--------------------------------------------------------------------------------
|
479
|
+
-- Shuts down the ORB.
|
480
|
+
--
|
481
|
+
-- Stops the ORB main loop if it is executing, handles all pending requests and
|
482
|
+
-- closes all connections.
|
483
|
+
--
|
484
|
+
-- @usage oil.shutdown()
|
485
|
+
--
|
486
|
+
function shutdown()
|
487
|
+
return assert.results(RequestReceiver.acceptor:halt())
|
488
|
+
end
|
489
|
+
|
490
|
+
--------------------------------------------------------------------------------
|
491
|
+
-- Internal coroutine scheduler used by OiL.
|
492
|
+
--
|
493
|
+
-- This is a alias for a facet of the Task Manager component of the internal
|
494
|
+
-- architecture.
|
495
|
+
-- If the current assembly does not provide this component, this field is 'nil'.
|
496
|
+
-- It provides the same API of the 'loop.thread.Scheduler' class.
|
497
|
+
--
|
498
|
+
-- @usage thread = oil.tasks:current()
|
499
|
+
-- @usage oil.tasks:suspend()
|
500
|
+
-- @usage oil.tasks:resume(thread)
|
501
|
+
--
|
502
|
+
tasks = BasicSystem and BasicSystem.tasks
|
503
|
+
|
504
|
+
--------------------------------------------------------------------------------
|
505
|
+
-- Function that must be used to perform protected calls in applications.
|
506
|
+
--
|
507
|
+
-- It is a 'coroutine-safe' version of the 'pcall' function of the Lua standard
|
508
|
+
-- library.
|
509
|
+
--
|
510
|
+
-- @param func function Function to be executed in protected mode.
|
511
|
+
-- @param ... any Additional parameters passed to protected function.
|
512
|
+
--
|
513
|
+
-- @param success boolean 'true' if function execution did not raised any errors
|
514
|
+
-- or 'false' otherwise.
|
515
|
+
-- @param ... any Values returned by the function or an the error raised by the
|
516
|
+
-- function.
|
517
|
+
--
|
518
|
+
pcall = tasks and tasks.pcall or luapcall
|
519
|
+
|
520
|
+
--------------------------------------------------------------------------------
|
521
|
+
-- Function executes the main function of the application.
|
522
|
+
--
|
523
|
+
-- The application's main function is executed in a new thread if the current
|
524
|
+
-- assembly provides thread support.
|
525
|
+
-- This may only return when the application terminates.
|
526
|
+
--
|
527
|
+
-- @param main function Appplication's main function.
|
528
|
+
--
|
529
|
+
-- @usage oil.main(oil.run)
|
530
|
+
-- @usage oil.main(function() print(oil.tostring(oil.getLIR())) oil.run() end)
|
531
|
+
--
|
532
|
+
function main(main, ...)
|
533
|
+
assert.type(main, "function", "main function")
|
534
|
+
if tasks then
|
535
|
+
assert.results(tasks:register(coroutine.create(main), tasks.currentkey))
|
536
|
+
return BasicSystem.control:run(...)
|
537
|
+
else
|
538
|
+
return main(...)
|
539
|
+
end
|
540
|
+
end
|
541
|
+
|
542
|
+
--------------------------------------------------------------------------------
|
543
|
+
-- Creates and starts the execution of a new the thread.
|
544
|
+
--
|
545
|
+
-- Creates a new thread to execute the function 'func' with the extra parameters
|
546
|
+
-- provided.
|
547
|
+
-- This function imediately starts the execution of the new thread and the
|
548
|
+
-- original thread is only resumed again acordingly to the the scheduler's
|
549
|
+
-- internal policy.
|
550
|
+
-- This function can only be invocated from others threads, including the one
|
551
|
+
-- executing the application's main function (see 'main').
|
552
|
+
--
|
553
|
+
-- @param func function Function that the new thread will execute.
|
554
|
+
-- @param ... any Additional parameters passed to the 'func' function.
|
555
|
+
--
|
556
|
+
-- @usage oil.main(function() oil.newthread(oil.run) oil.newproxy(oil.readfrom("ior")):register(localobj) end)
|
557
|
+
--
|
558
|
+
-- @see main
|
559
|
+
--
|
560
|
+
function newthread(func, ...)
|
561
|
+
assert.type(func, "function", "thread body")
|
562
|
+
return BasicSystem.tasks:start(func, ...)
|
563
|
+
end
|
564
|
+
|
565
|
+
--------------------------------------------------------------------------------
|
566
|
+
-- Suspends the execution of the current thread for some time.
|
567
|
+
--
|
568
|
+
-- @param time number Delay in seconds that the execution must be resumed.
|
569
|
+
--
|
570
|
+
-- @usage oil.sleep(5.5)
|
571
|
+
--
|
572
|
+
function sleep(time)
|
573
|
+
assert.type(time, "number", "time")
|
574
|
+
return BasicSystem.sockets:sleep(time)
|
575
|
+
end
|
576
|
+
|
577
|
+
--------------------------------------------------------------------------------
|
578
|
+
-- Get the current system time.
|
579
|
+
--
|
580
|
+
-- @return number Number of seconds since a fixed point in the past.
|
581
|
+
--
|
582
|
+
-- @usage local start = oil.time(); oil.sleep(3); print("I slept for", oil.time() - start)
|
583
|
+
--
|
584
|
+
function time()
|
585
|
+
return BasicSystem.sockets:gettime()
|
586
|
+
end
|
587
|
+
|
588
|
+
--------------------------------------------------------------------------------
|
589
|
+
-- Creates a new value encoder that marshal values into strings.
|
590
|
+
--
|
591
|
+
-- The encoder marshals values in a CORBA's CDR encapsulated stream, i.e.
|
592
|
+
-- includes an indication of the endianess used in value codification.
|
593
|
+
--
|
594
|
+
-- @return object Value encoder that provides operation 'put(value, [type])' to
|
595
|
+
-- marshal values and operation 'getdata()' to get the marshaled stream.
|
596
|
+
--
|
597
|
+
-- @usage encoder = oil.newencoder(); encoder:put({1,2,3}, oil.corba.idl.sequence{oil.corba.idl.long})
|
598
|
+
-- @usage encoder = oil.newencoder(); encoder:put({1,2,3}, oil.types:lookup("MyLongSeq"))
|
599
|
+
--
|
600
|
+
function newencoder()
|
601
|
+
return assert.results(ValueEncoder.codec:encoder(true))
|
602
|
+
end
|
603
|
+
|
604
|
+
--------------------------------------------------------------------------------
|
605
|
+
-- Creates a new value decoder that extracts marshaled values from strings.
|
606
|
+
--
|
607
|
+
-- The decoder reads CORBA's CDR encapsulated streams, i.e. includes an
|
608
|
+
-- indication of the endianess used in value codification.
|
609
|
+
--
|
610
|
+
-- @param stream string String containing a stream with marshaled values.
|
611
|
+
--
|
612
|
+
-- @return object Value decoder that provides operation 'get([type])' to
|
613
|
+
-- unmarshal values from a marshaled stream.
|
614
|
+
--
|
615
|
+
-- @usage decoder = oil.newdecoder(stream); val = decoder:get(oil.corba.idl.sequence{oil.corba.idl.long})
|
616
|
+
-- @usage decoder = oil.newdecoder(stream); val = decoder:get(oil.types:lookup("MyLongSeq"))
|
617
|
+
--
|
618
|
+
function newdecoder(stream)
|
619
|
+
assert.type(stream, "string", "byte stream")
|
620
|
+
return assert.results(ValueEncoder.codec:decoder(stream, true))
|
621
|
+
end
|
622
|
+
|
623
|
+
--------------------------------------------------------------------------------
|
624
|
+
-- Creates a new exception object with the given body.
|
625
|
+
--
|
626
|
+
-- The 'body' must contain the values of the exceptions fields and must also
|
627
|
+
-- contain the exception identification in index 1 (in CORBA this
|
628
|
+
-- identification is a repID).
|
629
|
+
--
|
630
|
+
-- @param body table Exception body with all its field values and exception ID.
|
631
|
+
--
|
632
|
+
-- @return object Exception that provides meta-method '__tostring' that provides
|
633
|
+
-- a pretty-printing.
|
634
|
+
--
|
635
|
+
-- @usage error(oil.newexcept{ "IDL:omg.org.CORBA/INTERNAL:1.0", minor_code_value = 2 })
|
636
|
+
--
|
637
|
+
function newexcept(body)
|
638
|
+
assert.type(body, "table", "exception body")
|
639
|
+
local except = assert.results(TypeRepository.types:resolve(body[1]))
|
640
|
+
assert.type(except, "idl except", "referenced exception type")
|
641
|
+
body[1] = except.repID
|
642
|
+
return assert.Exception(body)
|
643
|
+
end
|
644
|
+
|
645
|
+
--------------------------------------------------------------------------------
|
646
|
+
-- Defines a exception handling function for proxies.
|
647
|
+
--
|
648
|
+
-- The handling function receives the following parameters:
|
649
|
+
-- proxy : object proxy that perfomed the operation.
|
650
|
+
-- exception: exception/error raised.
|
651
|
+
-- operation: descriptor of the operation that raised the exception.
|
652
|
+
-- If the parameter 'type' is provided, then the exception handling function
|
653
|
+
-- will be applied only to proxies of that type (i.e. interface).
|
654
|
+
-- Exception handling functions are nor cumulative.
|
655
|
+
-- For example, is the is an exception handling function defined for all proxies
|
656
|
+
-- and other only for proxies of a given type, then the later will be used for
|
657
|
+
-- proxies of that given type.
|
658
|
+
-- Additionally, exceptions handlers are not inherited through interface
|
659
|
+
-- hierarchies.
|
660
|
+
--
|
661
|
+
-- @param handler function Exception handling function.
|
662
|
+
-- @param type string Interface ID of a group of proxies (e.g. repID).
|
663
|
+
--
|
664
|
+
-- @usage oil.setexcatch(function(_, except) error(tostring(except)) end)
|
665
|
+
--
|
666
|
+
function setexcatch(handler, type)
|
667
|
+
assert.results(ProxyManager.proxies:excepthandler(handler, type))
|
668
|
+
end
|
669
|
+
|
670
|
+
--------------------------------------------------------------------------------
|
671
|
+
-- This feature is disabled by default.
|
672
|
+
-- To enable this feature use the following command before requiring the 'oil'
|
673
|
+
-- package for the first time.
|
674
|
+
--
|
675
|
+
-- package.loaded["oil.component"] = require "loop.component.wrapped"
|
676
|
+
-- package.loaded["oil.port"] = require "loop.component.intercepted"
|
677
|
+
--
|
678
|
+
local port = require "oil.port"
|
679
|
+
local ClientSide = require "oil.corba.interceptors.ClientSide"
|
680
|
+
local ServerSide = require "oil.corba.interceptors.ServerSide"
|
681
|
+
|
682
|
+
--------------------------------------------------------------------------------
|
683
|
+
-- Sets a CORBA-specific interceptor for operation invocations in the client-size.
|
684
|
+
--
|
685
|
+
-- The interceptor must provide the following operations
|
686
|
+
--
|
687
|
+
-- send_request(request): 'request' structure is described below.
|
688
|
+
-- response_expected: [boolean] (read-only)
|
689
|
+
-- object_key: [string] (read-only)
|
690
|
+
-- operation: [string] (read-only) Operation name.
|
691
|
+
-- service_context: [table] Set this value to define a service context
|
692
|
+
-- values. See 'ServiceContextList' in CORBA specs.
|
693
|
+
-- success: [boolean] set this value to cancel invocation:
|
694
|
+
-- true ==> invocation successfull
|
695
|
+
-- false ==> invocation raised an exception
|
696
|
+
-- Note: The integer indexes store the operation's parameter values and
|
697
|
+
-- should also be used to store the results values if the request is canceled
|
698
|
+
-- (see note below).
|
699
|
+
--
|
700
|
+
-- receive_reply(reply): 'reply' structure is described below.
|
701
|
+
-- service_context: [table] (read-only) See 'ServiceContextList' in CORBA
|
702
|
+
-- specs.
|
703
|
+
-- reply_status: [string] (read-only)
|
704
|
+
-- success: [boolean] Identifies the kind of result:
|
705
|
+
-- true ==> invocation successfull
|
706
|
+
-- false ==> invocation raised an exception
|
707
|
+
-- Note: The integer indexes store the results that will be sent as request
|
708
|
+
-- result. For successful invocations these values must be the operation's
|
709
|
+
-- results (return, out and inout parameters) in the same order they appear
|
710
|
+
-- in the IDL description. For failed invocations, index 1 must be the
|
711
|
+
-- exception that identifies the failure.
|
712
|
+
--
|
713
|
+
-- The 'request' and 'reply' are the same table in a single invocation.
|
714
|
+
-- Therefore, the fields of 'request' are also available in 'reply' except for
|
715
|
+
-- those defined in the description of 'reply'.
|
716
|
+
--
|
717
|
+
function setclientinterceptor(iceptor)
|
718
|
+
if iceptor then
|
719
|
+
iceptor = ClientSide{ interceptor = iceptor }
|
720
|
+
end
|
721
|
+
local port = require "loop.component.intercepted"
|
722
|
+
port.intercept(OperationRequester, "requests", "method", iceptor)
|
723
|
+
port.intercept(OperationRequester, "messenger", "method", iceptor)
|
724
|
+
end
|
725
|
+
|
726
|
+
--------------------------------------------------------------------------------
|
727
|
+
-- Sets a CORBA-specific interceptor for operation invocations in the server-size.
|
728
|
+
--
|
729
|
+
-- The interceptor must provide the following operations
|
730
|
+
--
|
731
|
+
-- receive_request(request): 'request' structure is described below.
|
732
|
+
-- service_context: [table] (read-only) See 'ServiceContextList' in CORBA
|
733
|
+
-- specs.
|
734
|
+
-- request_id: [number] (read-only)
|
735
|
+
-- response_expected: [boolean] (read-only)
|
736
|
+
-- object_key: [string] (read-only)
|
737
|
+
-- operation: [string] (read-only) Operation name.
|
738
|
+
-- servant: [object] (read-only) Local object the invocation will be dispatched to.
|
739
|
+
-- method: [function] (read-only) Function that will be invoked on object 'servant'.
|
740
|
+
-- success: [boolean] Set this value to cancel invocation:
|
741
|
+
-- true ==> invocation successfull
|
742
|
+
-- false ==> invocation raised an exception
|
743
|
+
-- Note: The integer indexes store the operation's parameter values and
|
744
|
+
-- should also be used to store the results values if the request is canceled
|
745
|
+
-- (see note below).
|
746
|
+
--
|
747
|
+
-- send_reply(reply): 'reply' structure is described below.
|
748
|
+
-- service_context: [table] Set this value to define a service context
|
749
|
+
-- values. See 'ServiceContextList' in CORBA specs.
|
750
|
+
-- success: [boolean] identifies the kind of result:
|
751
|
+
-- true ==> invocation successfull
|
752
|
+
-- false ==> invocation raised an exception
|
753
|
+
-- Note: The integer indexes store the results that will be sent as request
|
754
|
+
-- result. For successful invocations these values must be the operation's
|
755
|
+
-- results (return, out and inout parameters) in the same order they appear
|
756
|
+
-- in the IDL description. For failed invocations, index 1 must be the
|
757
|
+
-- exception that identifies the failure.
|
758
|
+
--
|
759
|
+
-- The 'request' and 'reply' are the same table in a single invocation.
|
760
|
+
-- Therefore, the fields of 'request' are also available in 'reply' except for
|
761
|
+
-- those defined in the description of 'reply'.
|
762
|
+
--
|
763
|
+
function setserverinterceptor(iceptor)
|
764
|
+
if iceptor then
|
765
|
+
iceptor = ServerSide{ interceptor = iceptor }
|
766
|
+
end
|
767
|
+
local port = require "loop.component.intercepted"
|
768
|
+
port.intercept(RequestListener, "messenger", "method", iceptor)
|
769
|
+
port.intercept(RequestDispatcher, "dispatcher", "method", iceptor)
|
770
|
+
end
|
771
|
+
|
772
|
+
--------------------------------------------------------------------------------
|
773
|
+
-- Alias of 'newservant' function.
|
774
|
+
--
|
775
|
+
-- For compatibility with old OiL applications.
|
776
|
+
--
|
777
|
+
-- @see newservant
|
778
|
+
--
|
779
|
+
newobject = newservant
|
780
|
+
|
781
|
+
--------------------------------------------------------------------------------
|
782
|
+
-- Alias of 'newservant' function.
|
783
|
+
--
|
784
|
+
-- For compatibility with LuaOrb applications.
|
785
|
+
--
|
786
|
+
-- @see newservant
|
787
|
+
--
|
788
|
+
createservant = newservant
|
789
|
+
|
790
|
+
--------------------------------------------------------------------------------
|
791
|
+
-- Alias of 'newproxy' function.
|
792
|
+
--
|
793
|
+
-- For compatibility with LuaOrb applications.
|
794
|
+
--
|
795
|
+
-- @see newproxy
|
796
|
+
--
|
797
|
+
createproxy = newproxy
|
798
|
+
|
799
|
+
--------------------------------------------------------------------------------
|
800
|
+
-- Writes a text into file.
|
801
|
+
--
|
802
|
+
-- Utility function for writing stringfied IORs into a file.
|
803
|
+
--
|
804
|
+
function writeto(filepath, text)
|
805
|
+
local result, errmsg = io.open(filepath, "w")
|
806
|
+
if result then
|
807
|
+
local file = result
|
808
|
+
result, errmsg = file:write(text)
|
809
|
+
file:close()
|
810
|
+
end
|
811
|
+
return result, errmsg
|
812
|
+
end
|
813
|
+
|
814
|
+
--------------------------------------------------------------------------------
|
815
|
+
-- Read the contents of a file.
|
816
|
+
--
|
817
|
+
-- Utility function for reading stringfied IORs from a file.
|
818
|
+
--
|
819
|
+
function readfrom(filepath)
|
820
|
+
local result, errmsg = io.open(filepath)
|
821
|
+
if result then
|
822
|
+
local file = result
|
823
|
+
result, errmsg = file:read("*a")
|
824
|
+
file:close()
|
825
|
+
end
|
826
|
+
return result, errmsg
|
827
|
+
end
|
828
|
+
|
829
|
+
--------------------------------------------------------------------------------
|
830
|
+
-- Creates a file with the IOR of an object.
|
831
|
+
--
|
832
|
+
-- For compatibility with older versions of OiL.
|
833
|
+
--
|
834
|
+
function writeIOR(object, file)
|
835
|
+
return writeto(file, tostring(object))
|
836
|
+
end
|
837
|
+
|
838
|
+
--------------------------------------------------------------------------------
|
839
|
+
-- Alias of 'readfrom' function.
|
840
|
+
--
|
841
|
+
-- For compatibility with older versions of OiL.
|
842
|
+
|
843
|
+
readIOR = readfrom
|
844
|
+
|
845
|
+
--------------------------------------------------------------------------------
|
846
|
+
return _M
|