de.enough.polish.event
Class AsynchronousItemCommandListener

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

public class AsynchronousItemCommandListener
extends java.lang.Object
implements java.lang.Runnable, javax.microedition.lcdui.ItemCommandListener

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
AsynchronousItemCommandListener(javax.microedition.lcdui.ItemCommandListener parent)
          Creates a new threaded command listener
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command cmd, javax.microedition.lcdui.Item item)
           
 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

AsynchronousItemCommandListener

public AsynchronousItemCommandListener(javax.microedition.lcdui.ItemCommandListener parent)
Creates a new threaded command listener

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.Item item)
Specified by:
commandAction in interface javax.microedition.lcdui.ItemCommandListener