|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.sip.SipServlet
com.ibm.twss.common.siputils.SipApplicationSessionLock
public class SipApplicationSessionLock
This servlet serves as a SipServlet superclass that performs SipApplicationSession-based locking. It prevents two messages from the same application session from being processed concurrently, and attempts to intelligently handle cases where incoming messages belong to existing but invalid application session or sip session. This locking mechanism introduces an interesting problem, namely that SipSessions may be invalidated between when the message arrives and when it enters subclass code.
Field Summary |
---|
Fields inherited from class javax.servlet.sip.SipServlet |
---|
SIP_FACTORY, SUPPORTED, TIMER_SERVICE |
Constructor Summary | |
---|---|
SipApplicationSessionLock()
|
Method Summary | |
---|---|
protected void |
doRequest(javax.servlet.sip.SipServletRequest req)
For incoming requests, determine if the session is valid, lock, and then delegate to SipServlet.doRequest. |
protected void |
doRequestPerJSR116Section3Point3(javax.servlet.sip.SipServletRequest req)
For incoming requests, behave per JSR 116 section 3.3 on page 17: All other methods check whether the request is an initial request, as described in section 8.2.8. |
protected void |
doResponse(javax.servlet.sip.SipServletResponse resp)
For incoming responses, determine if the sesion is valid, lock, and delegate to SipServlet.doResponse. |
protected void |
doUpdate(javax.servlet.sip.SipServletRequest req)
Provide a default implementation of UPDATE processing. |
static boolean |
isSessionValid(javax.servlet.sip.SipApplicationSession sas)
Utility method to determine if a given SipApplicationSession is "valid" according to JSR 116. |
static boolean |
isSessionValid(javax.servlet.sip.SipSession ss)
Utility method to determine if a given SipSession is "valid" according to JSR 116. |
Methods inherited from class javax.servlet.sip.SipServlet |
---|
doAck, doBye, doCancel, doErrorResponse, doInfo, doInvite, doMessage, doNotify, doOptions, doPrack, doProvisionalResponse, doPublish, doRedirectResponse, doRegister, doSubscribe, doSuccessResponse, getServletConfig, getServletContext, init, log, log, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletInfo, getServletName, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SipApplicationSessionLock()
Method Detail |
---|
protected void doRequest(javax.servlet.sip.SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException
doRequest
in class javax.servlet.sip.SipServlet
req
- to process, provided by the container.
javax.servlet.ServletException
java.io.IOException
SipServlet.doRequest(javax.servlet.sip.SipServletRequest)
protected void doRequestPerJSR116Section3Point3(javax.servlet.sip.SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException
All other methods check whether the request is an initial request, as described in section 8.2.8. If the request is initial, it is rejected with status code 500; otherwise the method does nothing...This method is necessary because some of our subclasses will need to delegate to new SIP request types (like UPDATE). The standard patten is do so with a construct like
protected void doRequest(SipServletRequest request)
throws ServletException, IOException {
if ("STORE".equals(request.getMethod())) {
doStore(request);
} else {
super.doRequest(request);
}
}
which does not work for SipApplicationSessionLock. This method is
to provide a default behavior for methods like doUpdate so that
children can subclass them appropriately.
req
- to process, provided by the container.
javax.servlet.ServletException
java.io.IOException
SipServlet.doRequest(javax.servlet.sip.SipServletRequest)
protected void doUpdate(javax.servlet.sip.SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException
req
- to process, provided by the container.
javax.servlet.ServletException
java.io.IOException
SipServlet.doRequest(javax.servlet.sip.SipServletRequest)
protected void doResponse(javax.servlet.sip.SipServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doResponse
in class javax.servlet.sip.SipServlet
resp
- to process, provided by the container.
javax.servlet.ServletException
java.io.IOException
SipServlet.doResponse(javax.servlet.sip.SipServletResponse)
public static boolean isSessionValid(javax.servlet.sip.SipApplicationSession sas)
sas
- session to check.
public static boolean isSessionValid(javax.servlet.sip.SipSession ss)
ss
- session to check.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |