Websphere MQ Everyplace

examples.midp.exampleapp.msgpump
Class InputThread

java.lang.Object
  |
  +--examples.midp.exampleapp.msgpump.InputThread
All Implemented Interfaces:
java.lang.Runnable

public class InputThread
extends java.lang.Object
implements java.lang.Runnable

This class aims to be a simple commandline user interface. It captures user input on System.in and sends the information to a controller. It is aimed to be run as a thread in the background to ensure that blocking functions do not prevent the user from inputting command.

Start and prompt texts are also allowed - the starttext is shown when the class is started and the prompttext is displayed after every command the user enters.

The thread will keep running until the user enters the command 'quit' at which point this final command will be sent to the controller to process and this thread will stop().

This will only be used by commandline interfaces and not by MIDP UIs.


Field Summary
static short[] version
           
 
Constructor Summary
InputThread(NormalClient controller, java.lang.String starttext, java.lang.String prompttext)
          Constructor for InputThread.
 
Method Summary
 void run()
          Waits for user input and then sends it to the controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version
Constructor Detail

InputThread

public InputThread(NormalClient controller,
                   java.lang.String starttext,
                   java.lang.String prompttext)
Constructor for InputThread.

Method Detail

run

public void run()
Waits for user input and then sends it to the controller. Stops after the user enters the command 'quit' (this command is sent to the controller before it stops).

Specified by:
run in interface java.lang.Runnable
Returns:
void

Websphere MQ Everyplace