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

Java Init类代码示例

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

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



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

示例1: bootBootstrapNode

import se.sics.kompics.Init; //导入依赖的package包/类
private void bootBootstrapNode() {
    Configuration myConf = Configuration.Factory.modifyWithOtherDB(baseConfig, "bootStrap/")
            .setIp(baseConfig.getBootstrapServer().getIp())
            .setPort(baseConfig.getBootstrapServer().getPort())
            .finalise();

    Address netSelf = new Address(myConf.getIp(), myConf.getPort(), null);

    Component deadLetterBox = create(VirtualNetworkChannel.DefaultDeadLetterComponent.class, Init.NONE);
    VirtualNetworkChannel vnc = VirtualNetworkChannel.connect(net,
            deadLetterBox.getNegative(Network.class),
            new MessageDestinationSelector(new HostAddress(netSelf)));
    Component manager = create(HostManager.class, new HostManagerInit(myConf, netSelf, vnc));

    connect(manager.getNegative(Timer.class), timer);

    trigger(Start.event, deadLetterBox.control());
    trigger(Start.event, manager.control());
    target = netSelf;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:21,代码来源:SimulatorComponent.java


示例2: bootNode

import se.sics.kompics.Init; //导入依赖的package包/类
private void bootNode(int port) {
    Configuration myConf = Configuration.Factory.modifyWithOtherDB(baseConfig, String.valueOf(port)+"/")
            .setIp(baseConfig.getBootstrapServer().getIp())
            .setPort(port)
            .finalise();

    Address netSelf = new Address(myConf.getIp(), myConf.getPort(), null);

    Component deadLetterBox = create(VirtualNetworkChannel.DefaultDeadLetterComponent.class, Init.NONE);
    VirtualNetworkChannel vnc = VirtualNetworkChannel.connect(net,
            deadLetterBox.getNegative(Network.class),
            new MessageDestinationSelector(new HostAddress(netSelf)));
    Component manager = create(HostManager.class, new HostManagerInit(myConf, netSelf, vnc));

    connect(manager.getNegative(Timer.class), timer);

    trigger(Start.event, deadLetterBox.control());
    trigger(Start.event, manager.control());
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:20,代码来源:SimulatorComponent.java


示例3: SimulatorMain

import se.sics.kompics.Init; //导入依赖的package包/类
public SimulatorMain() {
    VirtualSimulator.setSimulationPortType(PaxosExperiment.class);
    scenario = PaxosTest.getScenario();

    // create
    Component simulator = create(VirtualSimulator.class,
            new VirtualSimulatorInit((SimulationScheduler) PaxosTest.getScheduler(),
            scenario, new UniformRandomModel(5, 90)));
    Component simulationComponent = create(SimulatorComponent.class, Init.NONE);

    // connect
    connect(simulationComponent.getNegative(Network.class),
            simulator.getPositive(Network.class));
    connect(simulationComponent.getNegative(Timer.class),
            simulator.getPositive(Timer.class));
    connect(simulationComponent.getNegative(PaxosExperiment.class),
            simulator.getPositive(PaxosExperiment.class));
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:19,代码来源:SimulatorMain.java


示例4: NtTesterMain

import se.sics.kompics.Init; //导入依赖的package包/类
public NtTesterMain() throws IOException {
    ntConfig = NatTraverserConfiguration.build();
    rendezvousServerConfig
            = RendezvousServerConfiguration.build().
            setSessionExpirationTime(120 * 1000);
    timer = create(JavaTimer.class, Init.NONE);
    resolveIp = create(ResolveIp.class, Init.NONE);

    connect(resolveIp.getNegative(Timer.class), timer.getPositive(Timer.class));

    subscribe(handleStart, control);
    subscribe(handleGetIpResponse, resolveIp.getPositive(ResolveIpPort.class));
    subscribe(handleFault, resolveIp.getControl());
    subscribe(handleFault, timer.getControl());
    subscribe(handlePingTimeout, timer.getPositive(Timer.class));
    subscribe(handlePangTimeout, timer.getPositive(Timer.class));
}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:18,代码来源:NtTesterMain.java


示例5: generate

import se.sics.kompics.Init; //导入依赖的package包/类
@Override
public StartNodeEvent generate(final Integer self) {
    return new StartNodeEvent() {
        TAddress selfAdr;

        {
            try {
                selfAdr = new TAddress(InetAddress.getByName(IP), self);
            } catch (UnknownHostException ex) {
                throw new RuntimeException(ex);
            }
        }

        @Override
        public Address getNodeAddress() {
            return selfAdr;
        }

        @Override
        public Class getComponentDefinition() {
            return NodeParent.class;
        }

        @Override
        public Init getComponentInit() {
            return new NodeParent.Init(false, selfAdr, null, self, NODES);
        }

        @Override
        public String toString() {
            return "StartCreator<" + selfAdr.toString() + ">";
        }
    };
}
 
开发者ID:tobiajo,项目名称:jbstore,代码行数:35,代码来源:ScenarioGen.java


示例6: ComponentBodyAdapter

import se.sics.kompics.Init; //导入依赖的package包/类
ComponentBodyAdapter(ResolutionContext context, JDefinedClass clazz) {
    super(context, clazz);
    initBlock = clazz.instanceInit();
    handlerType = (JClass) context.unit._ref(Handler.class);
    posPortType = (JClass) context.unit._ref(Positive.class);
    negPortType = (JClass) context.unit._ref(Negative.class);
    componentType = (JClass) context.unit._ref(Component.class);
    initType = (JClass) context.unit._ref(Init.class);
}
 
开发者ID:kompics,项目名称:kola,代码行数:10,代码来源:ComponentBodyAdapter.java


示例7: ClientManager

import se.sics.kompics.Init; //导入依赖的package包/类
public ClientManager() {
    if (INSTANCE == null) {
        INSTANCE = this; // will work in Oracle JDK...Not sure about other implementations
    } else {
        throw new RuntimeException("Don't start the ClientManager twice! You are doing it wrong -.-");
    }
    if (conf == null) {
        conf = ConfigFactory.load();
    }
    sampleSize = conf.getInt("bootstrap.sampleSize");
    useLUT = conf.getBoolean("client.fetchLUT");
    String ipStr = conf.getString("bootstrap.address.hostname");
    String localHost = conf.getString("client.address.hostname");
    int bootPort = conf.getInt("bootstrap.address.port");
    int localPort = conf.getInt("client.address.port");
    InetAddress localIP = null;
    InetAddress bootIp = null;
    try {
        bootIp = InetAddress.getByName(ipStr);
        localIP = InetAddress.getByName(localHost);
    } catch (UnknownHostException ex) {
        throw new RuntimeException(ex.getMessage());
    }
    bootstrapServer = new Address(bootIp, bootPort, null);
    self = new Address(localIP, localPort, null);
    TimestampIdFactory.init(self);

    lut = new ReadOnlyLUT(self, RAND);

    network = create(NettyNetwork.class, new NettyInit(self));
    timer = create(JavaTimer.class, Init.NONE);
    vnc = VirtualNetworkChannel.connect(network.getPositive(Network.class), proxy);
    vnc.addConnection(null, net.getPair());

    subscribe(startHandler, control);
    subscribe(partHandler, net);
    subscribe(responseHandler, net);
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:39,代码来源:ClientManager.java


示例8: Parent

import se.sics.kompics.Init; //导入依赖的package包/类
public Parent() {
    Component sender = create(Sender.class, Init.NONE);
    Component receiver = create(Receiver.class, Init.NONE);
    Component senderNetty = create(NettyNetwork.class, new NettyInit(MsgSizeTest.senderAddr));
    Component receiverNetty = create(NettyNetwork.class, new NettyInit(MsgSizeTest.receiverAddr));
    connect(sender.getNegative(Network.class), senderNetty.getPositive(Network.class));
    connect(receiver.getNegative(Network.class), receiverNetty.getPositive(Network.class));
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:9,代码来源:Parent.java


示例9: bootNode

import se.sics.kompics.Init; //导入依赖的package包/类
private void bootNode(Address netSelf, View view) {

        Component deadLetterBox = create(VirtualNetworkChannel.DefaultDeadLetterComponent.class, Init.NONE);
        VirtualNetworkChannel vnc = VirtualNetworkChannel.connect(net,
                deadLetterBox.getNegative(Network.class),
                new MessageDestinationSelector(new HostAddress(netSelf)));
        Component manager = create(PaxosManager.class, new PaxosManagerInit(view, 100, netSelf, store));
        components.put(netSelf.getPort(), manager);

        connect(manager.getNegative(Network.class), net, new MessageDestinationSelector(new HostAddress(netSelf)));
        connect(manager.getNegative(Timer.class), timer);

        trigger(Start.event, deadLetterBox.control());
        trigger(Start.event, manager.control());
    }
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:16,代码来源:SimulatorComponent.java


示例10: MainComponent

import se.sics.kompics.Init; //导入依赖的package包/类
public MainComponent() {
    javaTimer = create(JavaTimer.class, Init.NONE);

    server = create(TimeoutTestServerFailure.class, Init.NONE);

    testRetryClient = create(TestRetryClientComponent.class, new RetryInit());
    connect(testRetryClient.getNegative(Timer.class),
            javaTimer.getPositive(Timer.class));

    connect(testRetryClient.getNegative(VodNetwork.class), server.getPositive(VodNetwork.class));
}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:12,代码来源:RetryClientServerFailureTest.java


示例11: TestStClientComponent

import se.sics.kompics.Init; //导入依赖的package包/类
public TestStClientComponent() {
    timer = create(JavaTimer.class, Init.NONE);
    ping = create(Ping.class, Init.NONE);

    ip = null;


    try {
        ip = InetAddress.getByName("193.10.67.135");

    } catch (UnknownHostException ex) {
        logger.error("UnknownHostException");
        testObj.fail();
    }

    connect(ping.getNegative(Timer.class), timer.getPositive(Timer.class));

    subscribe(handleStart, control);
    subscribe(handleFault, ping.getControl());
    subscribe(handlePingResponse, ping.getPositive(PingPort.class));

}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:23,代码来源:PingTest.java


示例12: create

import se.sics.kompics.Init; //导入依赖的package包/类
@Override
public <T extends ComponentDefinition> Component create(Class<T> definition, Init<T> initEvent) {
    return LauncherComponent.this.create(definition, initEvent);
}
 
开发者ID:kompics,项目名称:kompics,代码行数:5,代码来源:NetworkTest.java


示例13: connect

import se.sics.kompics.Init; //导入依赖的package包/类
public static VirtualNetworkChannel connect(Positive<Network> sourcePort, ComponentProxy parent) {
    Component deadLetterBox = parent.create(DefaultDeadLetterComponent.class, Init.NONE);
    return connect(sourcePort, deadLetterBox.getNegative(Network.class));
}
 
开发者ID:kompics,项目名称:kompics,代码行数:5,代码来源:VirtualNetworkChannel.java


示例14: TestResolveIpComponent

import se.sics.kompics.Init; //导入依赖的package包/类
public TestResolveIpComponent() {
    resolveIp = create(ResolveIp.class, Init.NONE);
    timer = create(JavaTimer.class, Init.NONE);

    connect(resolveIp.getNegative(Timer.class), timer.getPositive(Timer.class));

    subscribe(handleStart, control);
    subscribe(handleGetIpResponse, resolveIp.getPositive(ResolveIpPort.class));

}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:11,代码来源:GetIpTest.java


示例15: MainComponent

import se.sics.kompics.Init; //导入依赖的package包/类
public MainComponent() {
    javaTimer = create(JavaTimer.class, Init.NONE);

    server = create(TimeoutTestServer.class, Init.NONE);

    testRetryClient = create(TestRetryClientComponent.class, new RetryInit<TestRetryClientComponent>());
    connect(testRetryClient.getNegative(Timer.class),
            javaTimer.getPositive(Timer.class));

    connect(testRetryClient.getNegative(VodNetwork.class),
            server.getPositive(VodNetwork.class));

}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:14,代码来源:MsgRetryTimeoutTest.java


示例16: MainComponent

import se.sics.kompics.Init; //导入依赖的package包/类
public MainComponent() {
    javaTimer = create(JavaTimer.class, Init.NONE);

    server = create(TimeoutTestServer.class, Init.NONE);

    testRetryClient = create(TestRetryClientComponent.class, new RetryInit());
    connect(testRetryClient.getNegative(Timer.class),
            javaTimer.getPositive(Timer.class));

    connect(testRetryClient.getNegative(VodNetwork.class), server.getPositive(VodNetwork.class));

}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:13,代码来源:RetryClientTimeoutTest.java


示例17: MainComponent

import se.sics.kompics.Init; //导入依赖的package包/类
public MainComponent() {
    javaTimer = create(JavaTimer.class, Init.NONE);

    server = create(Server.class, Init.NONE);

    testRetryClient = create(TestRetryClientComponent.class, new RetryInit());
    connect(testRetryClient.getNegative(Timer.class),
            javaTimer.getPositive(Timer.class));

    connect(testRetryClient.getNegative(VodNetwork.class), server.getPositive(VodNetwork.class));

}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:13,代码来源:RetryClientTest.java


示例18: create

import se.sics.kompics.Init; //导入依赖的package包/类
public <T extends ComponentDefinition> Component create(Class<T> definition, Init<T> initEvent); 
开发者ID:kompics,项目名称:kompics,代码行数:2,代码来源:ComponentProxy.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Pair类代码示例发布时间:2022-05-22
下一篇:
Java HandshakeTimeoutHandler类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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