| |
|
| example.cbs.CBSReceive
CBSReceive | public class CBSReceive extends MIDlet implements CommandListener,Runnable,MessageListener(Code) | | An example MIDlet displays text from a CBS MessageConnection
|
Field Summary | |
String | cbsMessageID | MessageConnection | cbsconn CBS message connection for inbound text messages. | String[] | connections Connections detected at start up. | Display | display current display. | boolean | done Flag to signal end of processing. | Command | exitCommand user interface command for indicating Exit request. | Message | msg Current message read from the network. | Alert | receivedMessage | Thread | thread instance of a thread for asynchronous networking and user interface. | Alert | waiting user interface text box for the "waiting" message. |
Constructor Summary | |
public | CBSReceive() Initialize the MIDlet with the current display object and
graphical components. |
Method Summary | |
public void | commandAction(Command c, Displayable s) | public void | destroyApp(boolean unconditional) Destroy must cleanup everything. | public void | notifyIncomingMessage(MessageConnection conn) Notification that a message arrived. | public void | pauseApp() Pause signals the thread to stop by clearing the thread field. | public void | run() Message reading thread. | public void | startApp() Start creates the thread to do the MessageConnection receive
text. |
cbsMessageID | String cbsMessageID(Code) | | The Message Identifier of the CBS messages we're listening for
|
cbsconn | MessageConnection cbsconn(Code) | | CBS message connection for inbound text messages.
|
connections | String[] connections(Code) | | Connections detected at start up.
|
display | Display display(Code) | | current display.
|
done | boolean done(Code) | | Flag to signal end of processing.
|
exitCommand | Command exitCommand(Code) | | user interface command for indicating Exit request.
|
msg | Message msg(Code) | | Current message read from the network.
|
receivedMessage | Alert receivedMessage(Code) | | Alert displaying the contents of the received message
|
thread | Thread thread(Code) | | instance of a thread for asynchronous networking and user interface.
|
waiting | Alert waiting(Code) | | user interface text box for the "waiting" message.
|
CBSReceive | public CBSReceive()(Code) | | Initialize the MIDlet with the current display object and
graphical components.
|
commandAction | public void commandAction(Command c, Displayable s)(Code) | | Respond to commands, including exit
Parameters: c - user interface command requested Parameters: s - screen object initiating the request |
destroyApp | public void destroyApp(boolean unconditional)(Code) | | Destroy must cleanup everything. The thread is signaled
to stop and no result is produced.
Parameters: unconditional - true if a forced shutdown was requested |
notifyIncomingMessage | public void notifyIncomingMessage(MessageConnection conn)(Code) | | Notification that a message arrived.
Parameters: conn - the connection with messages available |
pauseApp | public void pauseApp()(Code) | | Pause signals the thread to stop by clearing the thread field.
If stopped before done with the iterations it will
be restarted from scratch later.
|
run | public void run()(Code) | | Message reading thread.
|
startApp | public void startApp()(Code) | | Start creates the thread to do the MessageConnection receive
text.
It should return immediately to keep the dispatcher
from hanging.
|
|
|
|