JSAPI 2.0

javax.speech
Interface SpeechEventExecutor


public interface SpeechEventExecutor

Interface for objects that execute Runnable objects. The SpeechEventExecutor provides flexibility to merge SpeechEvents with other event queues.

The general intent is that execution can be asynchronous, or at least independent of the caller. For example, one of the simplest implementations of execute is

 new Thread(command).start();
 

For example uses of this interface to integrate speech events with lcdui or Swing events, see setSpeechEventExecutor.

This interface is compatible with more complete implementations that employ queuing or pooling, or perform additional bookkeeping. For example, see JSR-166 for J2SE. Java 2 Platform SE 5.0 defines a compatible interface.


Method Summary
 void execute(Runnable command)
          Executes the given command.
 

Method Detail

execute

void execute(Runnable command)
             throws IllegalStateException,
                    NullPointerException
Executes the given command. This method is guaranteed only to arrange for execution, that may actually occur sometime later; for example in a new thread. However, in fully generic use, callers should be prepared for execution to occur in any fashion at all, including immediate direct execution.

The method is defined not to throw any checked exceptions during execution of the command. Generally, any problems encountered will be asynchronous and so must be dealt with via callbacks or error handler objects. If necessary, any context-dependent catastrophic errors encountered during actions that arrange for execution could be accompanied by throwing context-dependent unchecked exceptions.

Parameters:
command - the command to execute on a thread
Throws:
IllegalStateException - if this task cannot be accepted for execution
NullPointerException - if command is null

JSAPI 2.0

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

Free Web Hosting