[8.5.5.7 or later]

SIP 1.1 annotations

Starting in SIP 1.1, you can use annotations in SIP servlet applications. You can use annotations to embed data directly in an application instead of using the deployment descriptor.

Annotations available in SIP 1.1

The following annotations are available in SIP 1.1:
  • @SipApplication
  • @SipServlet
  • @SipListener
  • @SipApplicationKey
Tip: You can still choose to use deployment descriptors instead of annotations. Deployment descriptors override settings that are described in the annotations.

@SipApplication annotation

The @SipApplication annotation defines common configuration information about an application. It is a package-level annotation and must be in a file named package-info.java. All servlets within the package belong to the same application.
Important: Only one SIP application can be registered with the container for each .war or .sar file, regardless of whether you use a deployment descriptor or annotations.

Table 1. Properties for @SipApplication and mapping to corresponding deployment descriptor elements
Annotation property Deployment descriptor element Description Default annotation value
name <app-name> The name of the SIP application Required field
displayName <display-name> Displayed name of the application Application name
description <description> Describes the application Empty string
smallicon <small-icon> Path with the location of the small icon Empty string
largeicon <large-icon> Path with the location of the large icon Empty string
distributable <destributable> Indicates if the application can function in a distributed environment False (boolean)
proxyTimeout <proxy-timeout> Default timeout for all proxy operations Three minutes, in seconds
sessionTimeout <session-timeout> Default timeout for all application session operations Three minutes, in minutes
mainServlet <main-servlet> Indicates the SIP servlet that is designed as the Main Servlet Empty string

@SipServlet annotation

The @SipServlet annotation indicates that a class is a SIP servlet.

Table 2. Properties for @SipServlet and mapping to corresponding deployment descriptor elements
Annotation property Deployment descriptor element Description Default annotation value
@SipServletServlet <servlet-class> Indicates that the class is a SIP servlet The annotation is declared on the class.
name <servlet-name> Name of the servlet Short name of the annotated class
applicationName <app-name> Name of the application Optional; it can also be defined either in the deployment descriptor or by using @SipApplication
loadOnStartup <load-on-startup> Defines the starting order of the servlet application A negative number (Causes the container to choose when to start this servlet)

@SipListener annotation

The @SipListener annotation provides an alternative to the <listener> deployment descriptor element.

The @SipListener annotation does not have any required fields, but can take an optional application name and description. The class that is annotated by @SipListener must implement at least one listener interface.

@SipApplicationKey annotation

The @SipApplicationKey annotation marks the method that associates an incoming request and SipSession with a specific SipApplicationSession. You use this annotation with session key-based targeting.

Icon that indicates the type of topic Reference topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: SIP_dd_mappingtoservlet.html