public abstract class AbstractShell extends Object implements Closeable
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractShell(Context context)
Creates a new instance of
AbstractShell. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
protected org.apache.ratis.thirdparty.com.google.common.io.Closer |
getCloser() |
Collection<Command> |
getCommands() |
protected abstract String |
getShellName() |
protected abstract Map<String,Command> |
loadCommands(Context context)
Map structure: Command name =>
Command instance. |
protected void |
printUsage()
Prints usage for all commands.
|
int |
run(String... argv)
Handles the specified shell command request, displaying usage if the command format is invalid.
|
protected AbstractShell(Context context)
AbstractShell.public int run(String... argv)
argv - [] Array of arguments given by the user's input from the terminalpublic Collection<Command> getCommands()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionprotected abstract String getShellName()
protected abstract Map<String,Command> loadCommands(Context context)
Command instance.protected org.apache.ratis.thirdparty.com.google.common.io.Closer getCloser()
protected void printUsage()
Copyright © 2017–2025 The Apache Software Foundation. All rights reserved.