public final class JVoiceXmlMain extends java.lang.Thread implements JVoiceXmlCore
This class manages all central resources and serves as a Session factory. It
is implemented as a singleton and cannot be instantiated from outside. On
startup, it acquires all needed resources and serves in turn as a source to
retrieve references to the DocumentServer and the
ImplementationPlatform.
During its life, the interpreter passes several states as shown in the
following figure. JVoiceXML can only process calls while it is in the running
state.
| Constructor and Description |
|---|
JVoiceXmlMain()
Construct a new object.
|
JVoiceXmlMain(Configuration config)
Construct a new object with the given configuration object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(JVoiceXmlMainListener listener)
Adds the given listener.
|
Session |
createSession(ConnectionInformation info)
Creates a new session.
|
Configuration |
getConfiguration()
Retrieves the configuration object if any.
|
DocumentServer |
getDocumentServer()
Retrieves a reference to the document server.
|
GrammarProcessor |
getGrammarProcessor()
Retrieves a reference to the grammar processor.
|
java.lang.String |
getVersion()
Retrieves the version information of JVoiceXml.
|
void |
removeListener(JVoiceXmlMainListener listener)
removes the given listener.
|
void |
run()
Starts the VoiceXML interpreter.
|
void |
setCallManager(java.util.Collection<CallManager> managers)
Set the call managers to use.
|
void |
setGrammarProcessor(GrammarProcessor processor)
Sets the grammar processor.
|
void |
setImplementationPlatformFactory(ImplementationPlatformFactory factory)
Sets the implementation platform factory.
|
void |
shutdown()
Shuts down the interpreter and frees all resources.
|
void |
waitShutdownComplete()
Waits until the VoiceXML interpreter has been shutdown.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic JVoiceXmlMain()
public JVoiceXmlMain(Configuration config)
config - the initial configurationpublic java.lang.String getVersion()
<VERSION_MAJOR>.<VERSION_MINOR>.<VERSION_BUGFIX_LEVEL>.<EA|GA>
.getVersion in interface JVoiceXmlpublic void addListener(JVoiceXmlMainListener listener)
listener - the listener to add.public void removeListener(JVoiceXmlMainListener listener)
listener - the listener to remove.public Session createSession(ConnectionInformation info) throws ErrorEvent
The Session is the entry point to start the interpreter. A
session is obtained by a ConnectionInformation.
createSession in interface JVoiceXmlinfo - information about the current connection,
maybe null. If it is null the
default implementation platform is used.ErrorEvent - Error creating the session.public Configuration getConfiguration()
getConfiguration in interface JVoiceXmlCorenull if there is no
configuration available.public DocumentServer getDocumentServer()
getDocumentServer in interface JVoiceXmlCorepublic GrammarProcessor getGrammarProcessor()
getGrammarProcessor in interface JVoiceXmlCorepublic void setImplementationPlatformFactory(ImplementationPlatformFactory factory)
The factory may need further configuration. See
Configurable.init(Configuration).
factory - the implementation platform factorypublic void setGrammarProcessor(GrammarProcessor processor)
The factory may need further configuration. See
Configurable.init(Configuration).
processor - the grammar processor.public void setCallManager(java.util.Collection<CallManager> managers) throws java.io.IOException, NoresourceError
managers - the call managers.java.io.IOException - error starting a call manager.NoresourceError - error starting a call manager.public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void shutdown()
public void waitShutdownComplete()