org.speakright.core
Class SRFactory

java.lang.Object
  extended by org.speakright.core.SRFactory
Direct Known Subclasses:
AppFactory

public class SRFactory
extends java.lang.Object


Constructor Summary
SRFactory()
           
 
Method Summary
 SRRunner createRunner(java.lang.String projectDir, java.lang.String returnUrl, java.lang.String baseUrl, ISRServlet servlet)
          Create a runner and initialize it.
 void initUrls(SRRunner run, java.lang.String returnUrl, java.lang.String baseUrl)
           
protected  void onCreateRunner(SRRunner run)
          A method you can override to do any addional initialization.
 void reInitRunner(SRRunner run, ISRServlet servlet)
          Re-initialize a runner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SRFactory

public SRFactory()
Method Detail

createRunner

public SRRunner createRunner(java.lang.String projectDir,
                             java.lang.String returnUrl,
                             java.lang.String baseUrl,
                             ISRServlet servlet)
Create a runner and initialize it. It inits the URLs and paths. It calls onCreateRunner which you can override to do any addional initialization.

Parameters:
projectDir - full path to project dir
returnUrl - absolute URL that voicexml pages postback to. eg http://localhost:8080/SimpsonsDemoServlet/App1
baseUrl - absolute URL of the web apps main directory. eg http://localhost:8080/SimpsonsDemoServlet It's used to set the prompt and grammar urls.
servlet - callback interface. can be null.
Returns:
runner

initUrls

public void initUrls(SRRunner run,
                     java.lang.String returnUrl,
                     java.lang.String baseUrl)

onCreateRunner

protected void onCreateRunner(SRRunner run)
A method you can override to do any addional initialization. Things apps may want to do here: - setting model and binder - registering prompt file - set extension factory Note. The ISRServlet.initLocations is done after onCreateRunner

Parameters:
run - has been initialized by createRunner

reInitRunner

public void reInitRunner(SRRunner run,
                         ISRServlet servlet)
Re-initialize a runner. Between postbacks the SRRunner object is serialized and then de-serialized. To reduce its size, some information is not stored and needs to be re-initialized. This method does that.

Parameters:
run - a runner object that was created by createRunner
servlet - callback interface. can be null.