• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript ice.Ice类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中ice.Ice的典型用法代码示例。如果您正苦于以下问题:TypeScript Ice类的具体用法?TypeScript Ice怎么用?TypeScript Ice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Ice类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: run

    async run(args:string[])
    {
        let communicator:Ice.Communicator;
        let echo:Test.EchoPrx;
        try
        {
            const [properties] = this.createTestProperties(args);
            properties.setProperty("Ice.Warn.Dispatch", "0");
            [communicator] = this.initialize(properties);

            echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint()));
            const adapter = await communicator.createObjectAdapter("");
            adapter.addServantLocator(new ServantLocatorI("category"), "category");
            adapter.addServantLocator(new ServantLocatorI(""), "");
            adapter.add(new TestI(), Ice.stringToIdentity("asm"));
            adapter.add(new TestActivationI(), Ice.stringToIdentity("test/activation"));
            await echo.setConnection();
            echo.ice_getCachedConnection().setAdapter(adapter);
            this.serverReady();
            await adapter.waitForDeactivate();
        }
        finally
        {
            if(echo)
            {
                await echo.shutdown();
            }
            if(communicator)
            {
                await communicator.destroy();
            }
        }
    }
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:33,代码来源:Server.ts


示例2: run

    async run(args:string[])
    {
        let communicator:Ice.Communicator;
        let echo:Test.EchoPrx;
        try
        {
            const [properties] = this.createTestProperties(args);
            properties.setProperty("Ice.BatchAutoFlushSize", "100");
            [communicator] = this.initialize(properties);
            echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint()));
            const adapter = await communicator.createObjectAdapter("");
            adapter.add(new AMDMyDerivedClassI(echo.ice_getEndpoints()), Ice.stringToIdentity("test"));
            await echo.setConnection();
            echo.ice_getCachedConnection().setAdapter(adapter);
            this.serverReady();
            await communicator.waitForShutdown();
        }
        finally
        {
            if(echo)
            {
                await echo.shutdown();
            }

            if(communicator)
            {
                await communicator.destroy();
            }
        }
    }
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:30,代码来源:ServerAMD.ts


示例3: opMyClass

 opMyClass(p1:Test.MyClassPrx, current:Ice.Current):[Test.MyClassPrx, Test.MyClassPrx, Test.MyClassPrx]
 {
     const p2 = p1;
     const p3 = Test.MyClassPrx.uncheckedCast(
         current.adapter.createProxy(Ice.stringToIdentity("noSuchIdentity")));
     const r = Test.MyClassPrx.uncheckedCast(current.adapter.createProxy(current.id));
     return [r.ice_endpoints(this._endpoints), p2, p3.ice_endpoints(this._endpoints)];
 }
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:8,代码来源:AMDMyDerivedClassI.ts


示例4: allTests

    allTests()
    {
        const out = this.getWriter();
        out.write("testing Slice predefined macros... ");

        const d = new Test._Default();
        test(d.x == 10);
        test(d.y == 10);

        const nd = new Test.NoDefault();
        test(nd.x != 10);
        test(nd.y != 10);

        const c = new Test.JsOnly();
        test(c.lang == "js");
        test(c.version == Ice.intVersion());

        out.writeLine("ok");
    }
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:19,代码来源:Client.ts


示例5: init

    async init()
    {
        const initData = new Ice.InitializationData();
        initData.properties = this._com.ice_getCommunicator().getProperties().clone();
        initData.logger = this._logger;
        initData.properties.setProperty("Ice.ACM.Timeout", "2");
        if(this._clientACMTimeout >= 0)
        {
            initData.properties.setProperty("Ice.ACM.Client.Timeout", String(this._clientACMTimeout));
        }
        if(this._clientACMClose >= 0)
        {
            initData.properties.setProperty("Ice.ACM.Client.Close", String(this._clientACMClose));
        }
        if(this._clientACMHeartbeat >= 0)
        {
            initData.properties.setProperty("Ice.ACM.Client.Heartbeat", String(this._clientACMHeartbeat));
        }
        this._communicator = Ice.initialize(initData);

        this._adapter = await this._com.createObjectAdapter(this._serverACMTimeout,
                                                            this._serverACMClose,
                                                            this._serverACMHeartbeat);
    }
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:24,代码来源:Client.ts


示例6: allTests

    async allTests()
    {
        class EmptyI extends Test.Empty
        {
        }

        class ServantLocatorI
        {
            locate(curr:Ice.Current, cookie:Object):Ice.Object
            {
                return null;
            }

            finished(curr:Ice.Current, servant:Ice.Object, cookie:Object):void
            {
            }

            deactivate(category:string):void
            {
            }
        }

        const out = this.getWriter();
        const communicator = this.communicator();
        out.write("testing object adapter registration exceptions... ");
        try
        {
            await communicator.createObjectAdapter("TestAdapter0");
            test(false);
        }
        catch(ex)
        {
            test(ex instanceof Ice.InitializationException, ex); // Expected
        }

        try
        {
            await communicator.createObjectAdapterWithEndpoints("TestAdapter0", "default");
            test(false);
        }
        catch(ex)
        {
            test(ex instanceof Ice.FeatureNotSupportedException, ex); // Expected
        }
        out.writeLine("ok");

        out.write("testing servant registration exceptions... ");
        {
            const adapter = await communicator.createObjectAdapter("");
            adapter.add(new EmptyI(), Ice.stringToIdentity("x"));
            try
            {
                adapter.add(new EmptyI(), Ice.stringToIdentity("x"));
                test(false);
            }
            catch(ex)
            {
                test(ex instanceof Ice.AlreadyRegisteredException, ex);
            }

            try
            {
                adapter.add(new EmptyI(), Ice.stringToIdentity(""));
                test(false);
            }
            catch(ex)
            {
                test(ex instanceof Ice.IllegalIdentityException, ex);
                test(ex.id.name === "");
            }

            try
            {
                adapter.add(null, Ice.stringToIdentity("x"));
                test(false);
            }
            catch(ex)
            {
                test(ex instanceof Ice.IllegalServantException, ex);
            }

            adapter.remove(Ice.stringToIdentity("x"));
            try
            {
                adapter.remove(Ice.stringToIdentity("x"));
                test(false);
            }
            catch(ex)
            {
                test(ex instanceof Ice.NotRegisteredException, ex);
            }
            await adapter.deactivate();
        }
        out.writeLine("ok");

        out.write("testing servant locator registration exceptions... ");
        {
            const adapter = await communicator.createObjectAdapter("");
            adapter.addServantLocator(new ServantLocatorI(), "x");
            try
//.........这里部分代码省略.........
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:101,代码来源:Client.ts



注:本文中的ice.Ice类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript ice.Ice.ArrayUtil类代码示例发布时间:2022-05-25
下一篇:
TypeScript i2c-bus.openSync函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap