The SIP Servlet Tutorial

Using the @SipApplication Annotation

The javax.servlet.sip.annotation.SipApplication application-level annotation is used to define a collection of SIP servlets and SIP listeners with a common configuration. @SipApplication is annotated at the package level, and all SIP servlets or listeners within the package are part of the defined SIP application unless the SIP servlet or listener explicitly sets the applicationName element in the @SipServlet or @SipListener annotation, respectively.

@SipApplication should be annotated either in a package-info.java file in a package hierarchy, or before the package definition in a particular source file.


Example 1–2 Example of @SipApplication Annotation in a package-info.java File

@SipApplication(name="MySipApplication")
package com.example.sip;

Table 1–5 @SipApplication Elements

Element 

Description 

name

The name of the logical collection of SIP servlets and listeners. This element is required. 

description

Optional description of the SIP application. 

displayName

Optional name for displaying in container administration tools. Defaults to the value of the name element.

distributable

Optional boolean indicating whether the application may be distributed by the container in a clustered environment. The default value is false.

largeIcon

An optional String indicating the location, relative to the root path of the archive, of a large icon for representing this application in container administration tools.

mainServlet

The optional name of the main SIP servlet for this application. 

proxyTimeout

An optional int value indicating the number of whole seconds before a timeout for all proxy operations in this SIP application.

sessionTimeout

An optional int value indicating the number of whole minutes before an application session timeout for all application sessions in this SIP application.

smallIcon

An optional String indicating the location, relative to the root path of the archive, of a small icon for representing this application in container administration tools.