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
- Author:
- joseph mcverry
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOMMAND_ERRORstatic java.lang.StringCOMMAND_NOT_FOUNDstatic java.lang.StringPROMPTstatic java.lang.StringSERVER_EXIT_COMMAND
-
Constructor Summary
Constructors Constructor Description StreamCommandProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Component lifecycle hook.java.io.BufferedReadergetReader()java.io.BufferedWritergetWriter()voidprocessCommand()java.lang.StringreadLine()voidwrite(java.lang.String text)voidwriteLine(java.lang.String line)-
Methods inherited from class org.openas2.cmd.processor.BaseCommandProcessor
addCommands, 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
-
-
Method Detail
-
getReader
public java.io.BufferedReader getReader()
-
getWriter
public java.io.BufferedWriter getWriter()
-
processCommand
public void processCommand() throws java.lang.Exception- Specified by:
processCommandin interfaceCommandProcessor- Specified by:
processCommandin 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.ExceptionDescription copied from interface:ComponentComponent lifecycle hook. If lifecycle ofComponentrequires a destroy function this method can be used.- Specified by:
destroyin interfaceComponent- Overrides:
destroyin classBaseCommandProcessor- Throws:
java.lang.Exception- Something went wrong- See Also:
Component.init(Session, Map),Session
-
-