本文整理匯總了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 ;