+

Search Tips   |   Advanced Search

 

Chaining SIP applications

 

You can set SIP application load priorities (weight) from the admin console.

The order in which modules pickup requests on composition is evaluated by applications weights first, then modules weights.

 

Overview

Specifying load-on-startup 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 will be 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 will not be initialized 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 that is embed 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. That is the startup number that gets set from the admin console.

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

The starting weight for applications and their modules is specified in the deployment.xml. The following example is for a standalone server.

Example:

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