| |
|
| java.lang.Object gov.nist.siplite.parser.PipelinedMsgParser
PipelinedMsgParser | final public class PipelinedMsgParser implements Runnable(Code) | | This implements a pipelined message parser suitable for use
with a stream - oriented input such as TCP. The client uses
this class by instatiating with an input stream from which
input is read and fed to a message parser.
It keeps reading from the input stream and process messages in a
never ending interpreter loop. The message listener interface gets called
for processing messages or for processing errors. The payload specified
by the content-length header is read directly from the input stream.
This can be accessed from the Message using the getContent and
getContentBytes methods provided by the Message class.
version: JAIN-SIP-1.1 version: This code is in the public domain. version: It was noticed that the parser was version: blocking so I threw out some cool pipelining which ran fast but only worked version: when the phase of the full moon matched its mood. Now things are serialized version: and life goes slower but more reliably. See Also: SIPMessageListener |
Method Summary | |
protected Object | clone() Create a new pipelined parser from an existing one. | public void | processInput() Start reading and processing input. | public void | run() This is input reading thread for the pipelined parser. | public void | setMessageListener(SIPMessageListener mlistener) Add a class that implements a MessageListener interface whose
methods get called * on successful parse and error conditons. |
sipMessageListener | protected SIPMessageListener sipMessageListener(Code) | | The message listener that is registered with this parser.
(The message listener has methods that can process correct
and erroneous messages.)
|
PipelinedMsgParser | protected PipelinedMsgParser()(Code) | | Default constructor.
|
PipelinedMsgParser | public PipelinedMsgParser(SIPMessageListener sipMessageListener, InputStream in, boolean debug)(Code) | | Constructor when we are given a message listener and an input stream
(could be a TCP connection or a file)
Parameters: sipMessageListener - Message listener which hasmethods that get calledback from the parser when a parse is complete Parameters: in - Input stream from which to read the input. Parameters: debug - Enable/disable tracing or lexical analyser switch. |
PipelinedMsgParser | public PipelinedMsgParser(SIPMessageListener mhandler, InputStream in)(Code) | | This is the constructor for the pipelined parser.
Parameters: mhandler - a MessageListener implementation thatprovides the message handlers tohandle correctly and incorrectly parsed messages. Parameters: in - An input stream to read messages from. |
PipelinedMsgParser | public PipelinedMsgParser(InputStream in)(Code) | | This is the constructor for the pipelined parser.
Parameters: in - - An input stream to read messages from. |
clone | protected Object clone()(Code) | | Create a new pipelined parser from an existing one.
A new pipelined parser that reads from the same inputstream. |
processInput | public void processInput()(Code) | | Start reading and processing input.
|
run | public void run()(Code) | | This is input reading thread for the pipelined parser.
You feed it input through the input stream (see the constructor)
and it calls back an event listener interface for message
processing or error.
It cleans up the input - dealing with things like line continuation
|
setMessageListener | public void setMessageListener(SIPMessageListener mlistener)(Code) | | Add a class that implements a MessageListener interface whose
methods get called * on successful parse and error conditons.
Parameters: mlistener - a MessageListenerimplementation that can react to correct and incorrectpars. |
|
|
|