JSAPI 2.0

javax.speech.spi
Interface EngineFactory


public interface EngineFactory

Implemented by EngineMode objects obtained through calls to the EngineListFactory objects of each speech technology implementation registered with the EngineManager class.

This interface is part of the Service Provider Interface (SPI). Application developers do not need to use this interface. EngineFactory is used internally by EngineManager and speech technology implementations.

Each speech technology implementation must provide subclasses of either RecognizerMode or SynthesizerMode to implement the EngineFactory interface. For example:

 public MyRecognizerMode extends RecognizerMode implements EngineFactory
 {
     ...
     public Engine createEngine() {
         // Use EngineMode features to create an appropriate Engine
     }
 }
 

This implementation mechanism allows the Engine to embed additional EngineMode information (e.g., implementation-specific identifiers, etc.) that simplifies creation of an Engine if requested by the EngineManager class. The implementation-specific EngineMode may need to override equals and other methods if implementation-specific features are defined.

The speech technology implementation must perform the same security checks on access to speech Engines as documented in the EngineManager class.

See Also:
EngineManager, EngineListFactory, EngineMode, RecognizerMode, SynthesizerMode

Method Summary
 Engine createEngine()
          Creates an Engine with the features specified by the EngineMode object implementing this interface.
 

Method Detail

createEngine

Engine createEngine()
                    throws IllegalArgumentException,
                           EngineException
Creates an Engine with the features specified by the EngineMode object implementing this interface. The new Engine should be created in the DEALLOCATED state.

Returns:
an Engine object
Throws:
IllegalArgumentException - if the features of the EngineMode do not refer to a known Engine
EngineException - The Engine defined by this EngineMode could not be properly created.
See Also:
DEALLOCATED

JSAPI 2.0

JavaTM Speech API 2.0, Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.

Free Web Hosting