本文整理汇总了Java中org.apache.catalina.tribes.group.RpcChannel.ALL_REPLY属性的典型用法代码示例。如果您正苦于以下问题:Java RpcChannel.ALL_REPLY属性的具体用法?Java RpcChannel.ALL_REPLY怎么用?Java RpcChannel.ALL_REPLY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.catalina.tribes.group.RpcChannel
的用法示例。
在下文中一共展示了RpcChannel.ALL_REPLY属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
public static void main(String[] args) throws Exception {
long pause = 3000;
int count = 1000000;
int stats = 10000;
String name = "EchoRpcId";
int options = RpcChannel.ALL_REPLY;
long timeout = 15000;
String message = "EchoRpcMessage";
if (args.length == 0) {
usage();
System.exit(1);
}
for (int i = 0; i < args.length; i++) {
if ("-threads".equals(args[i])) {
// Not used
} else if ("-count".equals(args[i])) {
count = Integer.parseInt(args[++i]);
System.out.println("Sending "+count+" messages.");
} else if ("-pause".equals(args[i])) {
pause = Long.parseLong(args[++i])*1000;
} else if ("-break".equals(args[i])) {
// Not used
} else if ("-stats".equals(args[i])) {
stats = Integer.parseInt(args[++i]);
System.out.println("Stats every "+stats+" message");
} else if ("-timeout".equals(args[i])) {
timeout = Long.parseLong(args[++i]);
} else if ("-message".equals(args[i])) {
message = args[++i];
} else if ("-name".equals(args[i])) {
name = args[++i];
} else if ("-mode".equals(args[i])) {
if ( "all".equals(args[++i]) ) options = RpcChannel.ALL_REPLY;
else if ( "first".equals(args[i]) ) options = RpcChannel.FIRST_REPLY;
else if ( "majority".equals(args[i]) ) options = RpcChannel.MAJORITY_REPLY;
} else if ("-debug".equals(args[i])) {
// Not used
} else if ("-help".equals(args[i])) {
usage();
System.exit(1);
}
}
ManagedChannel channel = (ManagedChannel)ChannelCreator.createChannel(args);
EchoRpcTest test = new EchoRpcTest(channel,name,count,message,pause,options,timeout);
channel.start(Channel.DEFAULT);
Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
test.run();
System.out.println("System test complete, sleeping to let threads finish.");
Thread.sleep(60*1000*60);
}
示例2: main
public static void main(String[] args) throws Exception {
long pause = 3000;
int count = 1000000;
int stats = 10000;
String name = "EchoRpcId";
int options = RpcChannel.ALL_REPLY;
long timeout = 15000;
String message = "EchoRpcMessage";
if (args.length == 0) {
usage();
System.exit(1);
}
for (int i = 0; i < args.length; i++) {
if ("-threads".equals(args[i])) {
// Not used
} else if ("-count".equals(args[i])) {
count = Integer.parseInt(args[++i]);
System.out.println("Sending "+count+" messages.");
} else if ("-pause".equals(args[i])) {
pause = Long.parseLong(args[++i])*1000;
} else if ("-break".equals(args[i])) {
// Not used
} else if ("-stats".equals(args[i])) {
stats = Integer.parseInt(args[++i]);
System.out.println("Stats every "+stats+" message");
} else if ("-timeout".equals(args[i])) {
timeout = Long.parseLong(args[++i]);
} else if ("-message".equals(args[i])) {
message = args[++i];
} else if ("-name".equals(args[i])) {
name = args[++i];
} else if ("-mode".equals(args[i])) {
if ( "all".equals(args[++i]) ) options = RpcChannel.ALL_REPLY;
else if ( "first".equals(args[i]) ) options = RpcChannel.FIRST_REPLY;
else if ( "majority".equals(args[i]) ) options = RpcChannel.MAJORITY_REPLY;
} else if ("-debug".equals(args[i])) {
// Not used
} else if ("-help".equals(args[i])) {
usage();
System.exit(1);
}
}
ManagedChannel channel = (ManagedChannel)ChannelCreator.createChannel(args);
EchoRpcTest test = new EchoRpcTest(channel,name,count,message,pause,options,timeout);
channel.start(Channel.DEFAULT);
Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
test.run();
System.out.println("System test complete, sleeping to let threads finish.");
Thread.sleep(60*1000*60);
}