本文整理汇总了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);
}
}
示例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);
}
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}