Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop SIP applications > Develop SIP applications


Set up SIP application composition

The JSR 116 standard for SIP applications states in section 2.4 that multiple applications may be invoked for the same SIP request. The process of setting up applications to comply with this standard is called application composition.

Application composition requires that implementations use a cascaded services model. The cascaded services model requires that service applications triggered on the same host are triggered in sequence, as if the triggering occurred on different hosts. Therefore responses flow upstream and hit applications in the reverse order of the corresponding requests.

The JSR 116 standard does not specify how to implement application composition, thus there are many ways to comply with this standard. For WAS, composition of the application depends on the deployed application order, and on the order of mapping rules within the deployment descriptor of each application.

We can specify load on start-up priority. The <load-on-startup> in the sip.xml defines the order in which servlets are initialized on startup. If this value is lower than zero, the servlets are initialized when the first request is matched to them according to matching rule and composition order. Zero is a legitimate weight for startup initialization order. If this tag does not exist or if it contains a negative value, the servlet does not initialize at startup.

You should also add <load-on-startup> to the same tag in the web.xml if you are changing it manually. It is the WebContainer that loads servlets (and siplets), and it looks only at the web.xml. When deploying a SAR, only the sip.xml needs to be changed. The web.xml is automatically constructed correctly after deployment.

The load-on-startup tag embedded in the SIP deployment descriptor tag for a servlet dictates the order that the application is loaded on start up of the server. It does not dictate the order that an application gets called when the application is a member of an application composition chain that matches rules to process a new message coming in.

The starting weight for applications and their modules is specified in the deployment.xml file. The order in which modules pickup requests on composition is evaluated by applications weight first and then modules weight. The following steps can be completed in any order to specify applications weight or modules weight from the admin console.


Procedure

  1. To specify the applications (EARs) weight, expand Enterprise Applications > applicationName > Startup Behavior and set the startup order.

  2. To specify the modules (WARs) weight, expand Enterprise Applications > applicationName > Manage Modules and set the starting weight.

  3. Restart the changed applications.


Example

Specifying load-on-startup priority example:

sip.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sip-app
PUBLIC "-//Java Community Process//DTD SIP Application 1.0//EN"
"http://www.jcp.org/dtd/sip-app_1_0.dtd">
<sip-app>
<display-name>SIPSampleProxy
</display-name>

<servlet>
<servlet-name>SIPSampleProxy
</servlet-name>
<servlet-class>sipes.test.container.proxy.SIPSampleProxy
</servlet-class>
<load-on-startup>1
</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>SIPSampleProxy
</servlet-name>
<pattern>
<equal>
<var>request.uri.user
</var>
<value>SIPSampleProxy
</value>
</equal>
</pattern>
</servlet-mapping>

<proxy-config>
<sequential-search-timeout>1000
</sequential-search-timeout>
</proxy-config>
<session-config>
<session-timeout>12
</session-timeout>
</session-config>
</sip-app>
web.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp">
<display-name>SIPSampleProxy
</display-name>
<servlet>
<servlet-name>SIPSampleProxy
</servlet-name>
<display-name>SIPSampleProxy
</display-name>
<servlet-class>sipes.test.container.proxy.SIPSampleProxy
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SIPSampleProxy
</servlet-name>
<url-pattern>/SIPSampleProxy
</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html
</welcome-file>
<welcome-file>index.htm
</welcome-file>
<welcome-file>index.jsp
</welcome-file>
<welcome-file>default.html
</welcome-file>
<welcome-file>default.htm
</welcome-file>
<welcome-file>default.jsp
</welcome-file>
</welcome-file-list>
</web-app> 

Specifying starting weight example:

The following example is for a stand-alone server.

deployment.xml


<?xml version="1.0" encoding="UTF-8" ?>
-
<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi"
xmi:id="Deployment_1137951186883"> -
<deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1137951186883"
deploymentId="0" startingWeight="1" binariesURL="$(APP_INSTALL_ROOT)/OrangeNode08Cell/SipContainerTestSuite.ear"
useMetadataFromBinaries="false" enableDistribution="true" createMBeansForResources="true" reloadEnabled="false"
appContextIDForSecurity="href:OrangeNode08Cell/SipContainerTestSuite"
filePermission=".*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755" allowDispatchRemoteInclude="false"
allowServiceRemoteInclude="false">
<targetMappings xmi:id="DeploymentTargetMapping_1137951186883" enable="true" target="ServerTarget_1137951186883" />

<classloader xmi:id="Classloader_1137951186883" mode="PARENT_FIRST" />
-
<modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1137951186883"
deploymentId="1" startingWeight="10000" uri="sipunit.war">
<targetMappings xmi:id="DeploymentTargetMapping_1137951186884" target="ServerTarget_1137951186883" />

<classloader xmi:id="Classloader_1137951186884" />
</modules>
<properties xmi:id="Property_1137951186883" name="validateinstall" value="warn" />
</deployedObject>
<deploymentTargets xmi:type="appdeployment:ServerTarget" xmi:id="ServerTarget_1137951186883"
name="server1" nodeName="OrangeNode10" />
</appdeployment:Deployment>

Browse all SIP topics
Develop SIP applications


Related


SIP industry standards compliance

+

Search Tips   |   Advanced Search