public class StreamCommandProcessor extends BaseCommandProcessor
in this release made the process a thread so it can be shared with other command processors like the SocketCommandProcessor created innerclass CommandTokenizer so it could handle quotes and spaces within quotes
| Modifier and Type | Field and Description |
|---|---|
static String |
COMMAND_ERROR |
static String |
COMMAND_NOT_FOUND |
static String |
PROMPT |
static String |
SERVER_EXIT_COMMAND |
| Constructor and Description |
|---|
StreamCommandProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Component lifecycle hook.
|
BufferedReader |
getReader() |
BufferedWriter |
getWriter() |
void |
processCommand() |
String |
readLine() |
void |
write(String text) |
void |
writeLine(String line) |
addCommands, getCommands, getName, getParameters, getSession, init, schedule, terminatepublic static final String COMMAND_NOT_FOUND
public static final String COMMAND_ERROR
public static final String SERVER_EXIT_COMMAND
public static final String PROMPT
public BufferedReader getReader()
public BufferedWriter getWriter()
public void processCommand()
throws Exception
processCommand in interface CommandProcessorprocessCommand in class BaseCommandProcessorExceptionpublic String readLine() throws IOException
IOExceptionpublic void write(String text) throws IOException
IOExceptionpublic void writeLine(String line) throws IOException
IOExceptionpublic void destroy()
throws Exception
ComponentComponent requires a destroy function this method can be used.destroy in interface Componentdestroy in class BaseCommandProcessorException - Something went wrongComponent.init(Session, Map),
SessionCopyright © 2019. All rights reserved.