|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.sip.SipServlet org.echarts.servlet.sip.EChartsSipServlet
public class EChartsSipServlet
SipServlet that provides a gateway to ECharts-defined application logic. The application
developer uses this class as is, rather than subclassing as is the practice in traditional
servlet programming. Upon receipt of an initial request, this class creates an instance
of a FeatureBox that contains the application logic specified in the init-param
called machineClassName
, or a B2BUA machine if none is specified. Subsequent
messages are dispatched to ports associated with the appropriate SipSession
.
Field Summary | |
---|---|
static java.lang.String |
FEATURE_BOX
|
static java.lang.String |
IS_INCOMING
|
protected static Monitor |
monitor
|
static java.lang.String |
SERVLET_NAME
|
Fields inherited from class javax.servlet.sip.SipServlet |
---|
OUTBOUND_INTERFACES, PRACK_SUPPORTED, SIP_FACTORY, SIP_SESSIONS_UTIL, SUPPORTED, SUPPORTED_RFCs, TIMER_SERVICE |
Constructor Summary | |
---|---|
EChartsSipServlet()
|
Method Summary | |
---|---|
protected ContainerAdapter |
createContainerAdapter()
|
protected void |
createMonitor()
|
protected Request |
createRequest(SipServletRequest req)
Factory method to create an object of a specific subclass of Request to wrap a SipServletRequest that is dispatched to the application. |
protected Response |
createResponse(SipServletResponse resp)
Factory method to create an object of a specific subclass of Response to wrap a SipServletResponse that is dispatched to the application. |
void |
destroy()
|
static SipApplicationSession |
doNonSip(java.lang.Object req)
Create a FeatureBox via non-SIP means, analagous to doRequest. |
static SipApplicationSession |
doNonSip(java.lang.Object req,
java.lang.String boxAddress)
Create a FeatureBox via non-SIP means, analagous to doRequest. |
static SipApplicationSession |
doNonSip(java.lang.Object req,
java.lang.String boxAddress,
java.lang.Object echartsMachineToJava)
Create a FeatureBox via non-SIP means, analagous to doRequest. |
void |
doRequest(SipServletRequest req)
|
void |
doResponse(SipServletResponse resp)
|
static SipApplicationSession |
getApplicationSession(java.lang.String appSessionId)
Returns the SIP application session associated with the specified application session ID. |
static ContainerAdapter |
getContainerAdapter()
|
RequestModifier |
getDefaultModifier()
Deprecated. With support for standardized application composition, the need to have a "forwarding" capability built into many apps is now reduced. It can of course still be done with a RequestModifier, or in a separate app that can be composed with other functionality as desired. |
java.lang.Object[] |
getMachineArguments(FeatureBox box)
|
java.lang.String |
getMachineClassName()
|
protected static Monitor |
getMonitor()
Returns the monitor value currently used for newly created feature boxes. |
java.util.Properties |
getServletProperties()
Gets initialization parameters from sip.xml. |
static SipFactory |
getSipFactory()
|
void |
init(javax.servlet.ServletConfig sc)
Initializes servlet with values from deployment descriptor, creates a logfile for monitor events, enables or disables debug output. |
protected void |
servletInit(javax.servlet.ServletConfig config)
Called when the Servlet.init() is called by the container. |
void |
sessionCreated(SipApplicationSessionEvent ev)
for SipApplicationSessionListener interface |
void |
sessionDestroyed(SipApplicationSessionEvent ev)
for SipApplicationSessionListener interface |
void |
sessionExpired(SipApplicationSessionEvent ev)
Always extend application session lifetime. |
protected java.lang.String |
sessionKeyFromRequest(SipServletRequest req)
Generate the key used for key based session targeting mechanism. |
void |
sessionReadyToInvalidate(SipApplicationSessionEvent ev)
for SipApplicationSessionListener interface. |
protected static void |
setMonitor(Monitor monitor)
Set the monitor value to be used for all feature boxes created subsequent to calling this method. |
static java.lang.String |
sipApplicationKey(SipServletRequest req)
If the top-level ECharts machine implements BoundBoxMachine, this method calls BoundBoxMachine.sessionKey() to obtain the key used for key based SipApplicationSession targeting mechanism. |
Methods inherited from class javax.servlet.sip.SipServlet |
---|
doAck, doBranchResponse, doBye, doCancel, doErrorResponse, doInfo, doInvite, doMessage, doNotify, doOptions, doPrack, doProvisionalResponse, doPublish, doRedirectResponse, doRefer, doRegister, doSubscribe, doSuccessResponse, doUpdate, log, log, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Monitor monitor
public static final java.lang.String IS_INCOMING
public static final java.lang.String FEATURE_BOX
public static final java.lang.String SERVLET_NAME
Constructor Detail |
---|
public EChartsSipServlet()
Method Detail |
---|
protected java.lang.String sessionKeyFromRequest(SipServletRequest req)
This is only called if the top-level machine implements BoundBoxMachine. The default behavior is to return the String representation of the subscriber URI. An application may override this method to customize how the key is generated.
req
- initial request that the Application Router has selected
this application to handle
public static java.lang.String sipApplicationKey(SipServletRequest req)
protected Request createRequest(SipServletRequest req)
An application may override this method to create application-specific subclasses.
req
- the request that is dispatched to the application
protected Response createResponse(SipServletResponse resp)
An application may override this method to create application-specific subclasses.
resp
- the response that is dispatched to the application
protected void servletInit(javax.servlet.ServletConfig config) throws java.lang.Exception
The application can perform application-specific initialization which should only be run once per application (i.e. a servlet instance) by overriding this method. This is in contrast to the constructor method of the top-level machine class, which is executed once per application instance.
config
- a ServletConfig object container the servlet's
configuration and initialization parameters
java.lang.Exception
public static final SipApplicationSession getApplicationSession(java.lang.String appSessionId)
appSessionId
- SIP application session ID (as returned
by SipApplicationSession.getId())
public void init(javax.servlet.ServletConfig sc) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected void createMonitor()
protected ContainerAdapter createContainerAdapter()
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
public void doRequest(SipServletRequest req) throws NoPortAssignedException, PortException, FeatureBoxException, EChartsSipServletException
doRequest
in class SipServlet
NoPortAssignedException
PortException
FeatureBoxException
EChartsSipServletException
public void doResponse(SipServletResponse resp) throws NoPortAssignedException, PortException, FeatureBoxException
doResponse
in class SipServlet
NoPortAssignedException
PortException
FeatureBoxException
public static SipApplicationSession doNonSip(java.lang.Object req) throws NoPortAssignedException, PortException, FeatureBoxException, EChartsSipServletException
req
- non-SIP request to be supplied to BoxPort
NoPortAssignedException
PortException
FeatureBoxException
EChartsSipServletException
public static SipApplicationSession doNonSip(java.lang.Object req, java.lang.String boxAddress) throws NoPortAssignedException, PortException, FeatureBoxException, EChartsSipServletException
req
- non-SIP request to be supplied to BoxPortboxAddress
- desired address for box or null
NoPortAssignedException
PortException
FeatureBoxException
EChartsSipServletException
public static SipApplicationSession doNonSip(java.lang.Object req, java.lang.String boxAddress, java.lang.Object echartsMachineToJava) throws NoPortAssignedException, PortException, FeatureBoxException, EChartsSipServletException
EChartsMachineToJava.getInstance()
.
req
- non-SIP request to be supplied to BoxPortboxAddress
- desired address for box or nullechartsMachineToJava
- echartsMachineToJava instance or null
NoPortAssignedException
PortException
FeatureBoxException
EChartsSipServletException
public java.lang.String getMachineClassName()
init-param
called machineClassName
in the sip.xml
deployment descriptor. If none is
specified, a B2BUA is instantiated by default.public java.lang.Object[] getMachineArguments(FeatureBox box) throws java.lang.Exception
java.lang.Exception
public static final SipFactory getSipFactory()
public java.util.Properties getServletProperties()
sip.xml
deployment
descriptor.@Deprecated public RequestModifier getDefaultModifier()
init-params
in sip.xml
.
public void sessionCreated(SipApplicationSessionEvent ev)
sessionCreated
in interface SipApplicationSessionListener
public void sessionDestroyed(SipApplicationSessionEvent ev)
sessionDestroyed
in interface SipApplicationSessionListener
public final void sessionExpired(SipApplicationSessionEvent ev)
sessionExpired
in interface SipApplicationSessionListener
public void sessionReadyToInvalidate(SipApplicationSessionEvent ev)
sessionReadyToInvalidate
in interface SipApplicationSessionListener
protected static void setMonitor(Monitor monitor)
protected static Monitor getMonitor()
public static ContainerAdapter getContainerAdapter()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |