FileDocCategorySizeDatePackage
FatalMIDlet.javaAPI DocphoneME MR2 API (J2ME)2895Wed May 02 18:00:16 BST 2007com.sun.midp.events

FatalMIDlet

public class FatalMIDlet extends javax.microedition.midlet.MIDlet implements EventListener
Register an event listener, send an event to self, and throw a RuntimeException while processing an event.

Fields Summary
Constructors Summary
Methods Summary
public voiddestroyApp(boolean unconditional)
Does nothing.

param
unconditional is ignored

    
public voidpauseApp()
Pause; there are no resources that need to be released.

    
public booleanpreprocess(Event event, Event waitingEvent)
Preprocess an event that is being posted to the event queue. This method will get called in the thread that posted the event.

param
event event being posted
param
waitingEvent previous event of this type waiting in the queue to be processed
return
true to allow the post to continue, false to not post the event to the queue

        return true;
    
public voidprocess(Event event)
Process an event. This method will get called in the event queue processing thread.

param
event event to process

        throw new RuntimeException("fatal test error");
    
public voidstartApp()
Set up.

        EventQueue eventQueue;
        Event event;

        if (MIDletSuiteUtils.isAmsIsolate()) {
            // This is single VM mode don't throw a fatal error. Just end.
            notifyDestroyed();
            return;
        } 

        eventQueue = EventQueue.getEventQueue();

        eventQueue.registerEventListener(EventTypes.TEST_EVENT, this);

        event = new Event(EventTypes.TEST_EVENT);

        eventQueue.post(event);