|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.oki.sip.engine.SipRequestDispatcher
Dispatcher to call a SIP servlet from an HTTP servlet.
While HTTP servlet typically retrieves a servlet which is the destination of HTTP requests using ServletContext#getNamedDispatcher(String name), this class provides SIP servlet with this process. This means that HTTP servlet can use this class to invoke SIP servlet on the same servlet context. Note that it is different from the HTTP/HTTP forward in the following:
SipRequestParams
must be defined as a parameter of method to invoke.
In other words,
makeCall(ServletRequest req)
cannot be invoked due to difference in the argument,
while makeCall(SipRequestParams params)
method can be legally called.
Although the argument that can be specified when invoking the method is restricted to SipRequestParams, multiple arguments including one
specific to AP can be specified to be passed to SIP servlet because of the way to register multiple data provided for this class.
doXxx
method returns.
In contrast, the invoke method provided by this class can invoke a method on SIP servlet side at call time.
Processes on the HTTP servlet side will remain blocked until a called
method is returned, because the method is called synchronously on the SIP servlet side.
Therefore, you need to design so that methods invoked by this class can return as soon as possible to return control to the HTTP side.
SipConstants
,
ServletContext#getNamedDispatcher(String name),
RequestDispatcher#forward(ServletRequest request, ServletResponse response)Field Summary |
Constructor Summary | |
SipRequestDispatcher(java.lang.Object source,
javax.servlet.ServletContext context,
java.lang.String servletName)
Constructor. |
|
SipRequestDispatcher(java.lang.Object source,
java.lang.String contextName,
java.lang.String servletName)
Constructor. |
Method Summary | |
static SipRequestDispatcher |
getInstance(java.lang.Object source,
javax.servlet.ServletContext context,
java.lang.String servletName)
Factory method that creates SipRequestDispatcher object. |
static SipRequestDispatcher |
getInstance(java.lang.Object source,
java.lang.String contextName,
java.lang.String servletName)
Factory method that creates SipRequestDispatcher object. |
java.lang.Object |
invoke(java.lang.String methodName,
SipRequestParams params)
Method that invokes a method on a SIP servlet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SipRequestDispatcher(java.lang.Object source, java.lang.String contextName, java.lang.String servletName) throws javax.servlet.ServletException
source
- Caller information. Recorded on access log.contextName
- Name of Context of HTTP servletservletName
- SIP servlet name
javax.servlet.ServletException
- Thrown if a specified context or servlet does not
exist.public SipRequestDispatcher(java.lang.Object source, javax.servlet.ServletContext context, java.lang.String servletName) throws javax.servlet.ServletException
source
- Caller information. Recorded on access log.context
- Context of HTTP or SIP servletservletName
- SIP servlet name to be invoked.
SIP servlet name indicates a name specified for the <servlet-name> tag in "sip.xml."
java.lang.IllegalArgumentException
- Exception that occurs if a caller specified for the source
is null
.
javax.servlet.ServletException
- Exception that occurs if no SIP servlet corresponding to a servlet specified for the
context exists or a SIP servlet corresponding to the servletName is not registered.Method Detail |
public static SipRequestDispatcher getInstance(java.lang.Object source, java.lang.String contextName, java.lang.String servletName) throws javax.servlet.ServletException
source
- Caller information. Recorded on access log.contextName
- Name of Context of HTTP servletservletName
- SIP servlet name
javax.servlet.ServletException
- Thrown if a specified context or servlet does not
exist.public static SipRequestDispatcher getInstance(java.lang.Object source, javax.servlet.ServletContext context, java.lang.String servletName) throws javax.servlet.ServletException
source
- Caller information. Recorded on access log.context
- Context of SIP servletservletName
- SIP servlet name
javax.servlet.ServletException
- Thrown if a specified context or servlet does not
exist.public java.lang.Object invoke(java.lang.String methodName, SipRequestParams params) throws java.lang.Exception
methodName
- Method name to be invoked.params
- Parameter passed as argument upon invoking.
java.lang.IllegalArgumentException
- Thrown if source or methodName is
null.
SipInvocationException
- Exception that occurred upon invoking method.
Contains the exception such as NoSuchMethodException other than
the one that invoked method explicitly threw.
Uses this exception class to store and return an exception that occurs when a method
is called, even if that exception is not in the Exception class.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |