org.jvoicexml.client.text
Class TextServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.jvoicexml.client.text.TextServer
All Implemented Interfaces:
Runnable

public final class TextServer
extends Thread

Socket server to stream text from and to the JVoiceXML interpreter using a text based client interface.

After starting the server using Thread.start() and registering TextListeners using addTextListener(TextListener) the output of JVoiceXml can be observed via the registered TextListener.

The ConnectionInformation object that has to be passed to the JVoiceXml.createSession(ConnectionInformation) method can be obtained via the getConnectionInformation() method.

Since:
0.6
Version:
$Revision: 2846 $
Author:
Dirk Schnelle-Walka

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TextServer(int serverPort)
          Constructs a new object.
 
Method Summary
 void addTextListener(TextListener textListener)
          Adds the given text listener to the list of known listeners.
 ConnectionInformation getConnectionInformation()
          Creates a connection information container that can be used when making a call.
 void run()
          
 void sendInput(String input)
          Send the given input as a recognition result to JVoiceXml.
 void stopServer()
          Stops this server.
 void waitConnected()
          Waits until a connection to JVoiceXml has been established after an application has been called.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextServer

public TextServer(int serverPort)
Constructs a new object.

Parameters:
serverPort - port number to use.
Method Detail

addTextListener

public void addTextListener(TextListener textListener)
Adds the given text listener to the list of known listeners.

Parameters:
textListener - the listener to add.

getConnectionInformation

public ConnectionInformation getConnectionInformation()
                                               throws UnknownHostException
Creates a connection information container that can be used when making a call.

Returns:
connection information
Throws:
UnknownHostException - IP address could not be determined.

run

public void run()

Specified by:
run in interface Runnable
Overrides:
run in class Thread

waitConnected

public void waitConnected()
                   throws IOException
Waits until a connection to JVoiceXml has been established after an application has been called.

Throws:
IOException - Error in connection.

sendInput

public void sendInput(String input)
               throws IOException
Send the given input as a recognition result to JVoiceXml.

Parameters:
input - the input to send.
Throws:
IOException - Error sending the input.

stopServer

public void stopServer()
Stops this server.



Copyright © 2005-2009JVoiceXML group.