gov.nist.javax.sip.parser
クラス PipelinedMsgParser

java.lang.Object
  上位を拡張 gov.nist.javax.sip.parser.PipelinedMsgParser
すべての実装されたインタフェース:
java.lang.Runnable

public final class PipelinedMsgParser
extends java.lang.Object
implements java.lang.Runnable

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 SIPMessage using the getContent and getContentBytes methods provided by the SIPMessage class.

バージョン:
JAIN-SIP-1.1 $Revision: 1.15 $ $Date: 2004/05/30 18:55:56 $
作成者:
M. Ranganathan This code is in the public domain. Lamine Brahimi and Yann Duponchel (IBM Zurich) noticed that the parser was blocking so I threw out some cool pipelining which ran fast but only worked when the phase of the full moon matched its mood. Now things are serialized and life goes slower but more reliably.
関連項目:
SIPMessageListener

コンストラクタの概要
PipelinedMsgParser(Pipeline in)
          This is the constructor for the pipelined parser.
PipelinedMsgParser(SIPMessageListener sipMessageListener, Pipeline in, boolean debug, int maxMessageSize)
          Constructor when we are given a message listener and an input stream (could be a TCP connection or a file)
PipelinedMsgParser(SIPMessageListener mhandler, Pipeline in, int maxMsgSize)
          This is the constructor for the pipelined parser.
 
メソッドの概要
 void processInput()
          Start reading and processing input.
 void run()
          This is input reading thread for the pipelined parser.
 void setMessageListener(SIPMessageListener mlistener)
          Add a class that implements a SIPMessageListener interface whose methods get called * on successful parse and error conditons.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

PipelinedMsgParser

public PipelinedMsgParser(SIPMessageListener sipMessageListener,
                          Pipeline in,
                          boolean debug,
                          int maxMessageSize)
Constructor when we are given a message listener and an input stream (could be a TCP connection or a file)

パラメータ:
sipMessageListener - Message listener which has methods that get called back from the parser when a parse is complete
in - Input stream from which to read the input.
debug - Enable/disable tracing or lexical analyser switch.

PipelinedMsgParser

public PipelinedMsgParser(SIPMessageListener mhandler,
                          Pipeline in,
                          int maxMsgSize)
This is the constructor for the pipelined parser.

パラメータ:
mhandler - a SIPMessageListener implementation that provides the message handlers to handle correctly and incorrectly parsed messages.
in - An input stream to read messages from.

PipelinedMsgParser

public PipelinedMsgParser(Pipeline in)
This is the constructor for the pipelined parser.

パラメータ:
in - - An input stream to read messages from.
メソッドの詳細

processInput

public void processInput()
Start reading and processing input.


setMessageListener

public void setMessageListener(SIPMessageListener mlistener)
Add a class that implements a SIPMessageListener interface whose methods get called * on successful parse and error conditons.

パラメータ:
mlistener - a SIPMessageListener implementation that can react to correct and incorrect pars.

run

public void run()
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

定義:
インタフェース java.lang.Runnable 内の run