当前位置: 首页>>代码示例>>Java>>正文


Java JChannel.setName方法代码示例

本文整理汇总了Java中org.jgroups.JChannel.setName方法的典型用法代码示例。如果您正苦于以下问题:Java JChannel.setName方法的具体用法?Java JChannel.setName怎么用?Java JChannel.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jgroups.JChannel的用法示例。


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

示例1: start

import org.jgroups.JChannel; //导入方法依赖的package包/类
public void start() throws Exception {
    ch=new JChannel(props);
    if(name != null)
        ch.setName(name);
    lock_service=new LockService(ch);
    lock_service.addLockListener(this);
    ch.connect("lock-cluster");
    JmxConfigurator.registerChannel(ch, Util.getMBeanServer(), "lock-service", ch.getClusterName(), true);

    try {
        loop();
    }
    catch(Exception e) {
        e.printStackTrace();
    }
    finally {
        Util.close(ch);
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:20,代码来源:LockServiceDemo.java

示例2: start

import org.jgroups.JChannel; //导入方法依赖的package包/类
public void start() throws Exception {
    ch=new JChannel(props);
    if(name != null)
        ch.setName(name);
    execution_service=new ExecutionService(ch);
    runner=new ExecutionRunner(ch);
    ch.connect("executing-cluster");
    JmxConfigurator.registerChannel(ch, Util.getMBeanServer(), 
        "execution-service", ch.getClusterName(), true);
    
    // Start a consumer
    queue.add(executor.submit(runner));
    random = new Random();
    printValues = false;

    try {
        loop();
    }
    catch(Exception e) {
        e.printStackTrace();
    }
    finally {
        Util.close(ch);
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:26,代码来源:ExecutionServiceDemo.java

示例3: createTcpgossipChannel

import org.jgroups.JChannel; //导入方法依赖的package包/类
protected JChannel createTcpgossipChannel(String name) throws Exception {
    TCPGOSSIP gossip=new TCPGOSSIP();
    List<InetSocketAddress> initial_hosts=new ArrayList<>();
    initial_hosts.add(new InetSocketAddress(bind_addr, gossip_router_port));
    gossip.setInitialHosts(initial_hosts);

    JChannel ch=new JChannel(new TCP().setValue("use_send_queues",true)
                               .setValue("sock_conn_timeout",300).setValue("bind_addr", bind_addr),
                             gossip,
                             new MERGE3().setValue("min_interval",1000).setValue("max_interval",3000),
                             new FD().setValue("timeout",2000).setValue("max_tries",2),
                             new VERIFY_SUSPECT(),
                             new NAKACK2().setValue("use_mcast_xmit",false),
                             new UNICAST3(), new STABLE(), new GMS().joinTimeout(1000));
    if(name != null)
        ch.setName(name);
    return ch;
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:19,代码来源:TCPGOSSIP_Test.java

示例4: start

import org.jgroups.JChannel; //导入方法依赖的package包/类
void start(String props, String channel_name) throws Exception {
    ch=new JChannel(props);
    ch.setName(channel_name);
    ch.setReceiver(new ReceiverAdapter() {
        public void viewAccepted(View view) {
            System.out.println("-- view: " + view);
        }
    });
    loop();
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:11,代码来源:CounterServiceDemo.java

示例5: createTunnelChannel

import org.jgroups.JChannel; //导入方法依赖的package包/类
protected JChannel createTunnelChannel(String name, boolean include_failure_detection) throws Exception {
    TUNNEL tunnel=(TUNNEL)new TUNNEL().setValue("bind_addr", bind_addr).setValue("reconnect_interval", 1000);
    tunnel.setGossipRouterHosts(gossip_router_hosts);
    List<Protocol> protocols=new ArrayList<>();
    protocols.addAll(Arrays.asList(tunnel,new PING(),new MERGE3().setValue("min_interval",1000).setValue("max_interval",3000)));
    if(include_failure_detection)
        protocols.addAll(Arrays.asList(new FD().setValue("timeout", 2000).setValue("max_tries", 2), new VERIFY_SUSPECT()));
    protocols.addAll(Arrays.asList(new NAKACK2().setValue("use_mcast_xmit", false), new UNICAST3(), new STABLE(),
                                   new GMS().joinTimeout(10)));
    JChannel ch=new JChannel(protocols);
    if(name != null)
        ch.setName(name);
    return ch;
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:15,代码来源:GossipRouterTest.java

示例6: createTunnelChannel

import org.jgroups.JChannel; //导入方法依赖的package包/类
protected JChannel createTunnelChannel(String name) throws Exception {
    TUNNEL tunnel=(TUNNEL)new TUNNEL().setValue("bind_addr", InetAddress.getByName(bind_addr));
    tunnel.setGossipRouterHosts(gossip_router_hosts);
    JChannel ch=Util.createChannel(tunnel,
                                   new PING(),
                                   new MERGE3().setValue("min_interval", 1000).setValue("max_interval", 3000),
                                   new FD().setValue("timeout", 2000).setValue("max_tries", 2),
                                   new VERIFY_SUSPECT(),
                                   new NAKACK2().setValue("use_mcast_xmit", false),
                                   new UNICAST3(), new STABLE(), new GMS().joinTimeout(1000));
    if(name != null)
        ch.setName(name);
    return ch;
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:15,代码来源:TUNNELDeadLockTest.java

示例7: createChannel

import org.jgroups.JChannel; //导入方法依赖的package包/类
protected JChannel createChannel(String name) throws Exception {
    JChannel ch=new JChannel(new SHARED_LOOPBACK(),
                             new SHARED_LOOPBACK_PING(),
                             new FD(),
                             new NAKACK2().setValue("use_mcast_xmit", false),
                             new UNICAST3(),
                             new STABLE().setValue("max_bytes", 50000),
                             new GMS().setValue("print_local_addr", false),
                             new SUPERVISOR());
    ch.setName(name);
    return ch;
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:13,代码来源:SUPERVISOR_Test.java

示例8: createChannel

import org.jgroups.JChannel; //导入方法依赖的package包/类
protected JChannel createChannel(String name) throws Exception {
    JChannel ch=Util.createChannel(new SHARED_LOOPBACK(),
                                   new SHARED_LOOPBACK_PING(),
                                   new FD().setValue("timeout", 1000).setValue("max_tries", 3),
                                   new NAKACK2(),
                                   new UNICAST3(),
                                   new GMS().setValue("print_local_addr",false));
    ch.setName(name);
    return ch;
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:11,代码来源:FdMonitorTest.java

示例9: createChannel

import org.jgroups.JChannel; //导入方法依赖的package包/类
protected JChannel createChannel(String name) throws Exception {
    JChannel ch=new JChannel(new SHARED_LOOPBACK(),
                             new SHARED_LOOPBACK_PING(),
                             new NAKACK2().setValue("become_server_queue_size", 10),
                             new UNICAST3(),
                             new GMS().setValue("print_local_addr", false));
    ch.setName(name);
    return ch;
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:10,代码来源:MessageBeforeConnectedTest.java

示例10: createChannel

import org.jgroups.JChannel; //导入方法依赖的package包/类
protected JChannel createChannel(String name) throws Exception {
    JChannel ch=Util.createChannel(new SHARED_LOOPBACK(),
                                   new PING(),
                                   new NAKACK2().setValue("become_server_queue_size", 10),
                                   new UNICAST3(),
                                   new GMS().setValue("print_local_addr", false).setValue("join_timeout", 500));
    ch.setName(name);
    return ch;
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:10,代码来源:BecomeServerTest.java


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