org.jvoicexml.interpreter
Class JVoiceXmlSession

java.lang.Object
  extended by org.jvoicexml.interpreter.JVoiceXmlSession
All Implemented Interfaces:
Runnable, Session

public final class JVoiceXmlSession
extends Object
implements Session, Runnable

Implementation of a Session.

Each session is started in a new thread.

Version:
$Revision: 222 $

Copyright © 2005-2007 JVoiceXML group - http://jvoicexml.sourceforge.net/

Author:
Dirk Schnelle

Constructor Summary
JVoiceXmlSession(ImplementationPlatform ip, JVoiceXmlCore jvxml)
          Constructs a new object.
 
Method Summary
 void call(URI uri)
          Handles a call request. Starts this session in a new thread.
 void close()
          Closes this session.
 CharacterInput getCharacterInput()
          Retrieves the DTMF input device.
 DocumentServer getDocumentServer()
          Retrieves a reference to the document server.
 GrammarProcessor getGrammarProcessor()
          Retrieves a reference to the grammar processor.
 ImplementationPlatform getImplementationPlatform()
          Retrieves a reference to the used implementation platform.
 ScopeObserver getScopeObserver()
          Retrieves the scope observer for this session.
 ScriptingEngine getScriptingEngine()
          Retrieves the scripting engine.
 String getSessionID()
          Retrieves the universal unique identifier for this session.
 VoiceXmlInterpreterContext getVoiceXmlInterpreterContext()
          Retrieve the VoiceXmlInterpreterContext related to this session.
 void hangup()
          Handles a hangup request.
 void run()
           Starts this session in a new thread.
 void waitSessionEnd()
          Delays until the session ends.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JVoiceXmlSession

public JVoiceXmlSession(ImplementationPlatform ip,
                        JVoiceXmlCore jvxml)
Constructs a new object.

Parameters:
ip - The implementation platform.
jvxml - The main object to retrieve further resources.
Method Detail

getSessionID

public String getSessionID()
Retrieves the universal unique identifier for this session.

Specified by:
getSessionID in interface Session
Returns:
Universal unique identifier for this session.

call

public void call(URI uri)
          throws ErrorEvent
Handles a call request.

Starts processing of the given application and returns immediately.

Starts this session in a new thread.

Specified by:
call in interface Session
Parameters:
uri - URI of the first document to load.
Throws:
ErrorEvent - Error initiating the call.

hangup

public void hangup()
Handles a hangup request.

Specified by:
hangup in interface Session
Stuff to complete
Implement this method.

getCharacterInput

public CharacterInput getCharacterInput()
                                 throws NoresourceError
Retrieves the DTMF input device.

Specified by:
getCharacterInput in interface Session
Returns:
DTMF input device.
Throws:
NoresourceError - Input device is not available.

waitSessionEnd

public void waitSessionEnd()
                    throws ErrorEvent
Delays until the session ends.

Specified by:
waitSessionEnd in interface Session
Throws:
ErrorEvent - Error processing the call.

close

public void close()
Closes this session. After a session is closed, it can not be reopened i.e., to call another application.

If no hangup call was initiated, the session is aborted.

Specified by:
close in interface Session

run

public void run()
Starts this session in a new thread.

Specified by:
run in interface Runnable

getImplementationPlatform

public ImplementationPlatform getImplementationPlatform()
Retrieves a reference to the used implementation platform.

Returns:
The used implementation platform.

getDocumentServer

public DocumentServer getDocumentServer()
Retrieves a reference to the document server.

Returns:
The document server.

getGrammarProcessor

public GrammarProcessor getGrammarProcessor()
Retrieves a reference to the grammar processor.

Returns:
The grammar processor.
Since:
0.3

getVoiceXmlInterpreterContext

public VoiceXmlInterpreterContext getVoiceXmlInterpreterContext()
Retrieve the VoiceXmlInterpreterContext related to this session.

Returns:
The related context.

getScopeObserver

public ScopeObserver getScopeObserver()
Retrieves the scope observer for this session.

Returns:
The scope observer.

getScriptingEngine

public ScriptingEngine getScriptingEngine()
Retrieves the scripting engine.

Returns:
The scripting engine.
Since:
0.4


Copyright © 2005-2007 JVoiceXML group.