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 |
EXIT_COMMAND |
static String |
PROMPT |
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, terminate
public static final String COMMAND_NOT_FOUND
public static final String COMMAND_ERROR
public static final String EXIT_COMMAND
public static final String PROMPT
public BufferedReader getReader()
public BufferedWriter getWriter()
public void processCommand() throws Exception
processCommand
in interface CommandProcessor
processCommand
in class BaseCommandProcessor
Exception
public String readLine() throws IOException
IOException
public void write(String text) throws IOException
IOException
public void writeLine(String line) throws IOException
IOException
public void destroy() throws Exception
Component
Component
requires a destroy function this method can be used.destroy
in interface Component
destroy
in class BaseCommandProcessor
Exception
- Something went wrongComponent.init(Session, Map)
,
Session
Copyright © 2018. All rights reserved.