|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.speakright.core.SRRunner
public class SRRunner
The main class in SpeakRight. This class is the runtime
for a single instance (that is a single phone call).
It takes an application flow object (which has sub-flows)
and executes it, but asynchronously.
Begin by calling start. Then call getContent
to get the generated VoiceXML page. Send it off the the voicexml engine.
Then passivate this object until the HTTP reply from the voicexml engine
arrives. When it does, activate this object and call proceed,
then call getContent
to get the generated VoiceXML page. Send it off the the voicexml engine.
Repeat until isFinished is true.
This class wraps SRInstance to provide a safe public API.
| Field Summary | |
|---|---|
static java.lang.String |
SPEAKRIGHT_VERSION
|
| Constructor Summary | |
|---|---|
SRRunner()
|
|
| Method Summary | |
|---|---|
IFlow |
ApplicationFlow()
Get the outermost flow object, that was passed to start. |
boolean |
failed(SRError parent)
extracts any errors that this SRInstance object logged. |
void |
finishActivation()
MUST be called after activating (restoring this object using serialization). |
void |
generateFinPage()
Generate the final page for the application. |
java.lang.String |
getContent()
Get the content (the VoiceXML page). |
SRInstance |
getImpl()
For advance use only. |
boolean |
isFailed()
Has an error ocurred yet. |
boolean |
isFinished()
Has the application finished. |
boolean |
isPaused()
Is the application paused. |
boolean |
isStarted()
Has start been called. |
java.lang.String |
language()
Get the current language |
SRLocations |
locations()
Get the locations object, which holds directory and paths used by SpeakRight, such as the 'project dir'. |
void |
log(java.lang.String message)
Log to SpeakRight's logger (currently is log4j) |
void |
prepareToPassivate()
When saving state in a servlet, we're going to just save the whoe SRInstance object in the HttpSession. |
void |
proceed(SRResults results)
Continue execution, using the given results that we returned by the voicexml platform to determine what flow is executed next. |
void |
registerPromptFile(java.lang.String path)
Register a prompt file, for the duration of the call. |
void |
restoreModelBinder(IModelBinder binder)
|
void |
resume()
Resume (after pausing). |
boolean |
runAll(IFlow flow)
used for unit tests only. |
void |
setContentLogging(java.lang.String dir)
|
void |
setExtensionFactory(ISRExtensionFactory factory)
Set the extension point factory. |
void |
setGrammarBaseUrl(java.lang.String url)
Set the URL of grammar files. |
void |
setLanguage(java.lang.String lang)
Set the current language. |
void |
setModelBinder(IModel model,
IModelBinder binder)
|
void |
setPromptBaseUrl(java.lang.String url)
Set the URL of audio files. |
void |
setReturnUrl(java.lang.String url)
Set the return url, which is used in the submit VoiceXML tag to POST the results of a page back. |
boolean |
start(IFlow flow)
Start the application. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SPEAKRIGHT_VERSION
| Constructor Detail |
|---|
public SRRunner()
| Method Detail |
|---|
public SRInstance getImpl()
public void prepareToPassivate()
public void finishActivation()
public void registerPromptFile(java.lang.String path)
path - public void setReturnUrl(java.lang.String url)
url - public void setGrammarBaseUrl(java.lang.String url)
url - usually a url within the java web application, such
as "http://somecompany.com/speechapp1/grammar"public void setPromptBaseUrl(java.lang.String url)
url - usually a url within the java web application, such
as "http://somecompany.com/speechapp1/audio"public void log(java.lang.String message)
message - public boolean failed(SRError parent)
parent - error object to copy error info into.
public IFlow ApplicationFlow()
start.
public void setExtensionFactory(ISRExtensionFactory factory)
factory - public java.lang.String language()
public void setLanguage(java.lang.String lang)
s - language, such as "en-us"public SRLocations locations()
public boolean isFailed()
public boolean start(IFlow flow)
flow - the application flow object.
public java.lang.String getContent()
start or proceed
public void generateFinPage()
public void resume()
public boolean isPaused()
public void proceed(SRResults results)
results - results from the voicexml platform. These are the results of executing the previous page.public boolean isFinished()
public boolean isStarted()
start been called.
public void setModelBinder(IModel model,
IModelBinder binder)
public void restoreModelBinder(IModelBinder binder)
public void setContentLogging(java.lang.String dir)
public boolean runAll(IFlow flow)
flow -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||