|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvoicexml.implementation.jvxml.JVoiceXmlImplementationPlatform
public final class JVoiceXmlImplementationPlatform
Basic implementation of an ImplementationPlatform.
User actions and system output are not handled by this class but forwarded
to the corresponding ExternalResources.
External resources are considered to be in a pool. The implementation platform is able to retrieve them from the pool and push them back. This means that all resources that have been borrowed from the implementation platform must be returned to it if they are no longer used.
| Method Summary | |
|---|---|
void |
close()
Closes all open resources. |
CallControl |
getCallControl()
Retrieves the calling device. |
CharacterInput |
getCharacterInput()
Retrieves the DTMF input device. |
SystemOutput |
getSystemOutput()
Retrieves the audio output device. |
UserInput |
getUserInput()
Retrieves the user input device. |
boolean |
hasUserInput()
Checks, if there is an acquired user input device. |
void |
init(Configuration configuration)
Initializes this component with data from the given configuration object. |
void |
inputError(ErrorEvent error)
An error occured while an output processes an input. |
void |
inputStatusChanged(SpokenInputEvent event)
Notification about status changes in the SpokenInput. |
void |
outputError(ErrorEvent error)
An error occurred while an output processes an output. |
void |
outputStatusChanged(SynthesizedOutputEvent event)
Notification about status changes in the SynthesizedOutput. |
void |
queuePrompt(SpeakableText speakable)
Queues the given prompt without rendereing it. |
void |
renderPrompts(String sessionId,
DocumentServer server,
CallControlProperties props)
Notifies the implementation platform about the end of the prompt queuing that has been started by PromptAccumulator.setPromptTimeout(long). |
void |
resultAccepted(RecognitionResult result)
The user made an utterance that matched an active grammar. |
void |
resultRejected(RecognitionResult result)
The user made an utterance that did not match an active grammar. |
void |
setEventHandler(EventObserver observer)
Sets the event observer to communicate events back to the interpreter. |
void |
setExternalRecognitionListener(ExternalRecognitionListener listener)
Sets an external recognition listener and starts it. |
void |
setExternalSynthesisListener(ExternalSynthesisListener listener)
Sets an external synthesis listener and starts it. |
void |
setPromptTimeout(long timeout)
Sets the default timeout to use. |
void |
setSession(Session currentSession)
Sets the current session. |
void |
telephonyCallAnswered(TelephonyEvent event)
Invoked when the Telephony implementation triggered a
call answered event. |
void |
telephonyCallHungup(TelephonyEvent event)
Invoked when the Telephony implementation triggered a
call hangup event. |
void |
telephonyCallTransferred(TelephonyEvent event)
Invoked when the Telephony implementation triggered a
transfer event. |
void |
telephonyError(ErrorEvent error)
An error occured while communicating over the telephony. |
void |
telephonyMediaEvent(TelephonyEvent event)
Invoked when the Telephony implementation triggered an event. |
void |
waitNonBargeInPlayed()
Delays until all prompts are played that do not allow for barge-in. |
void |
waitOutputQueueEmpty()
Delays until all prompts are played. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void init(Configuration configuration)
throws ConfigurationException
init in interface Configurableconfiguration - the current configuration, maybe null
ConfigurationException - error initializing the component.public void setExternalRecognitionListener(ExternalRecognitionListener listener)
listener - the external recognition listener.public void setExternalSynthesisListener(ExternalSynthesisListener listener)
listener - the external synthesis listener.
public SystemOutput getSystemOutput()
throws NoresourceError,
ConnectionDisconnectHangupEvent
getSystemOutput in interface ImplementationPlatformnull.
NoresourceError - Output device is not available.
ConnectionDisconnectHangupEvent - the user hung uppublic void waitOutputQueueEmpty()
waitOutputQueueEmpty in interface ImplementationPlatformpublic void waitNonBargeInPlayed()
waitNonBargeInPlayed in interface ImplementationPlatform
public UserInput getUserInput()
throws NoresourceError,
ConnectionDisconnectHangupEvent
getUserInput in interface ImplementationPlatformnull.
NoresourceError - Input device is not available.
ConnectionDisconnectHangupEvent - the user hung uppublic boolean hasUserInput()
hasUserInput in interface ImplementationPlatformtrue if there is an acquired user input device.
public CharacterInput getCharacterInput()
throws NoresourceError,
ConnectionDisconnectHangupEvent
getCharacterInput in interface ImplementationPlatformNoresourceError - Input device is not available.
ConnectionDisconnectHangupEvent - the user hung up
public CallControl getCallControl()
throws NoresourceError,
ConnectionDisconnectHangupEvent
getCallControl in interface ImplementationPlatformnull.
NoresourceError - Calling device is not available.
ConnectionDisconnectHangupEvent - the user hung uppublic void close()
close in interface ImplementationPlatformpublic void setEventHandler(EventObserver observer)
setEventHandler in interface ImplementationPlatformobserver - The event observer.public void resultAccepted(RecognitionResult result)
result - the accepted recognition result.public void resultRejected(RecognitionResult result)
result - the rejected recognition result.public void inputStatusChanged(SpokenInputEvent event)
SpokenInput.
inputStatusChanged in interface SpokenInputListenerevent - the input event..public void telephonyCallAnswered(TelephonyEvent event)
Telephony implementation triggered a
call answered event.
telephonyCallAnswered in interface TelephonyListenerevent - the event.public void telephonyCallHungup(TelephonyEvent event)
Telephony implementation triggered a
call hangup event.
telephonyCallHungup in interface TelephonyListenerevent - the event.public void telephonyCallTransferred(TelephonyEvent event)
Telephony implementation triggered a
transfer event.
telephonyCallTransferred in interface TelephonyListenerevent - the event.public void telephonyMediaEvent(TelephonyEvent event)
Telephony implementation triggered an event.
telephonyMediaEvent in interface TelephonyListenerevent - the event.public void outputStatusChanged(SynthesizedOutputEvent event)
SynthesizedOutput.
outputStatusChanged in interface SynthesizedOutputListenerevent - the output event.public void setSession(Session currentSession)
setSession in interface ImplementationPlatformcurrentSession - the current session.public void outputError(ErrorEvent error)
This method is intended to feed back errors that happen while the
SystemOutput processes an output asynchronously.
Errors that happen while the output is queued should be reported
by throwing an appropriate error in the
SystemOutput.queueSpeakable(org.jvoicexml.SpeakableText, String, org.jvoicexml.DocumentServer)
method.
outputError in interface SynthesizedOutputListenererror - the errorpublic void inputError(ErrorEvent error)
This method is intended to feed back errors that happen while the
UserInput processes an input asynchronously.
inputError in interface SpokenInputListenererror - the errorpublic void telephonyError(ErrorEvent error)
This method is intended to feed back errors that happen while the
CallControl processes an output asynchronously.
telephonyError in interface TelephonyListenererror - the errorpublic void setPromptTimeout(long timeout)
This method is intended to be called prior to queuing prompts
via PromptAccumulator.queuePrompt(SpeakableText), so it also clears the list of
queued prompts.
setPromptTimeout in interface PromptAccumulatortimeout - default timeout.public void queuePrompt(SpeakableText speakable)
After all prompts have been queued, the end of prompt queuing must be
indicated by #renderPrompts(String, DocumentServer).
queuePrompt in interface PromptAccumulatorspeakable - the prompt to queue.
public void renderPrompts(String sessionId,
DocumentServer server,
CallControlProperties props)
throws BadFetchError,
NoresourceError,
ConnectionDisconnectHangupEvent
PromptAccumulator.setPromptTimeout(long).
It is assumed that the PromptAccumulator has knowledge about
the ImplementationPlatform to render the output.
renderPrompts in interface PromptAccumulatorsessionId - the current session idserver - the document server to useprops - properties for the call control
BadFetchError - error queuing the prompt
NoresourceError - Output device is not available.
ConnectionDisconnectHangupEvent - the user hung up
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||