cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
36
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: null on 05-12-2005 03:50:34 PM
Is it OK to call a static utility function like the one below from the doDecision(...) and/or getConfig(...) methods? The class constAML has no variables defined. The static method add(...) simply uses a couple of audium methods to create an audium element.

I feel it is OK since it is a reentrant code. Multiple audium threads should be able to enter this method. but just want to make sure that something strange is not happening in the Audium methods.

Thanks

Deepak


-----

class constAML {

public static VoiceElementConfig add( ElementAPI elementAPI, VoiceElementConfig defaults, VoiceElementConfig.AudioGroup audioGroup,
String nameOfText,
String text,
String wavFile)
throws AudiumException,ElementConfigException
{
VoiceElementConfig.StaticAudio audio =
defaults.new StaticAudio( text,wavFile);
audioGroup.addAudioItem(audio);
elementAPI.addToLog(nameOfText, text );
defaults.setAudioGroup(audioGroup);
return defaults;
}

Subject: RE: calling static methods from doDecision() and getConfig() calls
Replied by: Vance Vagell on 05-12-2005 05:35:05 PM
Hi Deepak,

Performing operations on Audium API objects in a static method will not encounter threading issues, so long as the static method is reentrant. Using reentrant methods, such as the one you posted, is essentially equivalent to running this code from within any custom element; it uses only Audium objects, stores nothing, and returns the data in an Audium object.

Regards,
Vance
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links