de.enough.polish.event
Class AsynchronousCommandListener

java.lang.Object
  extended by de.enough.polish.event.AsynchronousCommandListener
All Implemented Interfaces:
java.lang.Runnable, javax.microedition.lcdui.CommandListener

public class AsynchronousCommandListener
extends java.lang.Object
implements java.lang.Runnable, javax.microedition.lcdui.CommandListener

Processes commandAction events in (possibly several) separate threads.

Note that several long running operations are handled asynchronously, meaning they are handled at the same time in different threads. For processing several long running operations in a sequence you can use the ThreadedCommandListener.

Copyright Enough Software 2006 - 2008

 history
        March 12, 2007 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de
See Also:
ThreadedCommandListener

Constructor Summary
AsynchronousCommandListener(javax.microedition.lcdui.CommandListener parent)
          Creates a new AsynchronousCommandListener.java
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command cmd, javax.microedition.lcdui.Displayable disp)
           
 void requestStop()
          Stops the background thread of this command listener.
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchronousCommandListener

public AsynchronousCommandListener(javax.microedition.lcdui.CommandListener parent)
Creates a new AsynchronousCommandListener.java

Parameters:
parent - the parent CommandListener that is used to process commands in a background thread.
Throws:
java.lang.IllegalArgumentException - when parent is null
Method Detail

requestStop

public void requestStop()
Stops the background thread of this command listener. Please note that no further events will be processed after requestStop() has been called.


run

public void run()
Specified by:
run in interface java.lang.Runnable

commandAction

public void commandAction(javax.microedition.lcdui.Command cmd,
                          javax.microedition.lcdui.Displayable disp)
Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener