Cisco Cisco Customer Voice Portal 8.0(1) Developer's Guide

Page of 98
C
HAPTER 
10:
 
A
PPLICATION 
S
TART 
C
LASSES
 
 
V
OICE
XML
 
P
ROGRAMMING 
G
UIDE 
 
 
 
FOR 
C
ISCO 
U
NIFIED 
C
USTOMER 
V
OICE 
P
ORTAL 
R
ELEASE 
4.0(1) 
 
 
 
 
57
 
Chapter 10:
 Application Start Classes 
Application start classes are unlike most components in that they are not related to a call session. 
Application start classes are instead associated with a particular application and are executed 
when the application itself is initialized or updated. Currently, only the Java API can construct 
code to run when an application starts. 
An application can define in its application settings any number of application start classes. 
Cisco Unified CVP VoiceXML Server will execute the classes sequentially in the order they 
appear in the application’s settings. By conforming to this order, a developer can create an 
application start class that stores information that can then be referenced by subsequent start of 
application classes. 
The application settings can specify that an error on a particular application start class will cancel 
the application’s deployment. This is an optional attribute and by default the system will not 
allow an error in one of these classes to stop the application deployment. If set, an error 
encountered in the class will stop the application from being deployed, an error message will 
appear in the application server console, and an error event will be thrown to be logged by any 
error loggers. This attribute is provided should an application require its application start class to 
run without error for calls the application to succeed. 
There are four situations where the application start class is run: 
    The application server is launched. Unified CVP VoiceXML Server is configured to begin 
initializing applications once it is loaded by the application server. This process triggers each 
applications’ start classes to be run. 
    The Unified CVP VoiceXML Server web application is restarted. Most application servers 
provide the ability to restart just a certain web application running within it rather than 
restarting the entire application server. The act of restarting the web application that defines 
the VoiceXML Server will prompt it to start the application loading process just like an 
application server restart. 
    An application is deployed after the Unified CVP VoiceXML Server has started. Using the 
deployment administration scripts, an application can be deployed while the system is 
actively handling calls to other applications. When the application is loaded, the application 
start classes will be run. 
    An application is updated. The process of updating an application prompts Unified CVP 
VoiceXML Server to create a new instance of the application in memory, while keeping the 
old instance in memory long enough for all existing callers to complete their calls. The new 
application must initialize itself, including calling all application start classes. 
An application start class only has access to the Global API, which allows for the creation of 
global and application data. It does not have access to the Session API because it is not run 
within a call session and is associated only with an application, not a call.