本文整理汇总了Java中com.neverwinterdp.server.gateway.Command类的典型用法代码示例。如果您正苦于以下问题:Java Command类的具体用法?Java Command怎么用?Java Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Command类属于com.neverwinterdp.server.gateway包,在下文中一共展示了Command类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.neverwinterdp.server.gateway.Command; //导入依赖的package包/类
public void execute(Shell shell, ShellContext ctx, Command command) throws Exception {
if("help".equalsIgnoreCase(command.getSubCommand())) {
help() ;
return ;
}
Class<ShellSubCommand> clazz = (Class<ShellSubCommand>) subCommands.get(command.getSubCommand()) ;
if(clazz != null) {
ShellSubCommand subCommand = clazz.newInstance() ;
ctx.onStartCommand(this, subCommand);
try {
subCommand.execute(shell, ctx, command);
} catch(Throwable t) {
ctx.getExecuteContext().setError(t);
StringWriter writer = new StringWriter() ;
writer.append(command.getCommandLine()).append("\n") ;
t.printStackTrace(new PrintWriter(writer));
ctx.console().println(writer.getBuffer().toString());
}
ctx.onFinishCommand(this, subCommand);
}
}
示例2: execute
import com.neverwinterdp.server.gateway.Command; //导入依赖的package包/类
public void execute(Shell shell, ShellContext ctx, Command command) {
try {
command.mapAll(options);
new HelloQueuengin().run(options);
} catch (Exception e) {
e.printStackTrace();
}
}
示例3: execute
import com.neverwinterdp.server.gateway.Command; //导入依赖的package包/类
public void execute(Shell shell, ShellContext ctx, Command command) throws Exception {
ServiceCommandResult<ClusterMetricRegistrySnapshot>[] results = ctx.getClusterGateway().execute(command) ;
ctx.console().header("Cluster Metric Snapshot");
ClusterMetricPrinter printer = new ClusterMetricPrinter(ctx.console().getConsoleAppendable()) ;
for(int i = 0; i < results.length; i++) {
ServiceCommandResult<ClusterMetricRegistrySnapshot> sel = results[i] ;
if(sel.hasError()) {
ctx.console().println(sel.getError());
} else {
printer.print(sel.getResult());
}
}
}
示例4: execute
import com.neverwinterdp.server.gateway.Command; //导入依赖的package包/类
public void execute(Shell shell, ShellContext ctx, Command command) throws Exception {
ServiceCommandResult<Boolean>[] results = ctx.getClusterGateway().execute(command) ;
String[] explaination = {
"The result is true when the service implement the cleanup method. "
};
CommandResultPrinterUtil.printPrimitiveServiceResults(ctx, command, results, explaination);
}
示例5: execute
import com.neverwinterdp.server.gateway.Command; //导入依赖的package包/类
public void execute(Shell shell, ShellContext context, Command command) throws Exception {
command.mapAll(this);
if (times.size() > 0) {
long time = times.get(0);
if (time > 0)
Thread.sleep(time);
}
}
示例6: execute
import com.neverwinterdp.server.gateway.Command; //导入依赖的package包/类
public void execute(Shell shell, ShellContext ctx, Command command) throws Exception {
ServerCommandResult<ServerState>[] results = ctx.getClusterGateway().execute(command) ;
String[] explaination = {
"The result is the running state of the server."
};
CommandResultPrinterUtil.printPrimitiveServerResults(ctx, command, results, explaination);
}
示例7: execute
import com.neverwinterdp.server.gateway.Command; //导入依赖的package包/类
public void execute(Shell shell, ShellContext ctx, Command command) {
try {
command.mapAll(options);
new HelloSparkngin().run(options);
} catch (Exception e) {
e.printStackTrace();
}
}
示例8: execute
import com.neverwinterdp.server.gateway.Command; //导入依赖的package包/类
public void execute(Shell shell, ShellContext ctx, Command command) throws Exception {
ServerCommandResult<ModuleRegistration[]>[] results = ctx.getClusterGateway().execute(command) ;
list(ctx, results, "List Available Modules") ;
}
示例9: execute
import com.neverwinterdp.server.gateway.Command; //导入依赖的package包/类
abstract public void execute(Shell shell, ShellContext context, Command command) throws Exception ;