Package org.openas2.cmd.processor
Class StreamCommandProcessor
- java.lang.Object
-
- org.openas2.cmd.processor.BaseCommandProcessor
-
- org.openas2.cmd.processor.StreamCommandProcessor
-
- All Implemented Interfaces:
CommandProcessor
,Component
,HasSchedule
public class StreamCommandProcessor extends BaseCommandProcessor
original author unknownin 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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COMMAND_ERROR
static java.lang.String
COMMAND_NOT_FOUND
static java.lang.String
PROMPT
private java.io.BufferedReader
reader
static java.lang.String
SERVER_EXIT_COMMAND
private java.io.BufferedWriter
writer
-
Constructor Summary
Constructors Constructor Description StreamCommandProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Component lifecycle hook.java.io.BufferedReader
getReader()
java.io.BufferedWriter
getWriter()
void
processCommand()
java.lang.String
readLine()
void
write(java.lang.String text)
void
writeLine(java.lang.String line)
-
Methods inherited from class org.openas2.cmd.processor.BaseCommandProcessor
addCommands, getCommand, getCommands, getName, getParameters, getSession, init, schedule, terminate
-
-
-
-
Field Detail
-
COMMAND_NOT_FOUND
public static final java.lang.String COMMAND_NOT_FOUND
- See Also:
- Constant Field Values
-
COMMAND_ERROR
public static final java.lang.String COMMAND_ERROR
- See Also:
- Constant Field Values
-
SERVER_EXIT_COMMAND
public static final java.lang.String SERVER_EXIT_COMMAND
- See Also:
- Constant Field Values
-
PROMPT
public static final java.lang.String PROMPT
- See Also:
- Constant Field Values
-
reader
private java.io.BufferedReader reader
-
writer
private java.io.BufferedWriter writer
-
-
Method Detail
-
getReader
public java.io.BufferedReader getReader()
-
getWriter
public java.io.BufferedWriter getWriter()
-
processCommand
public void processCommand() throws java.lang.Exception
- Specified by:
processCommand
in interfaceCommandProcessor
- Specified by:
processCommand
in classBaseCommandProcessor
- Throws:
java.lang.Exception
-
readLine
public java.lang.String readLine() throws java.io.IOException
- Throws:
java.io.IOException
-
write
public void write(java.lang.String text) throws java.io.IOException
- Throws:
java.io.IOException
-
writeLine
public void writeLine(java.lang.String line) throws java.io.IOException
- Throws:
java.io.IOException
-
destroy
public void destroy() throws java.lang.Exception
Description copied from interface:Component
Component lifecycle hook. If lifecycle ofComponent
requires a destroy function this method can be used.- Specified by:
destroy
in interfaceComponent
- Overrides:
destroy
in classBaseCommandProcessor
- Throws:
java.lang.Exception
- Something went wrong- See Also:
Component.init(Session, Map)
,Session
-
-