FileDocCategorySizeDatePackage
SuiteRemover.javaAPI DocphoneME MR2 API (J2ME)2939Wed May 02 18:00:02 BST 2007com.sun.midp.scriptutil

SuiteRemover

public class SuiteRemover extends javax.microedition.midlet.MIDlet implements Runnable
Removes a suite.

Fields Summary
int
suiteId
ID of the suite.
Constructors Summary
public SuiteRemover()
Create and initialize the MIDlet.

        // The arg-<n> properties are generic command arguments
        String suiteArg = getAppProperty("arg-0");

        if (suiteArg == null) {
            System.err.println("Suite ID argument missing.");
            System.err.println("Suite remover arguments: <suite ID>");
            notifyDestroyed();
            return;
        }

        try {
            suiteId = Integer.parseInt(suiteArg);
        } catch (Throwable t) {
            System.err.println("Suite ID: " + t.getMessage());
            notifyDestroyed();
        }            

        new Thread(this).start();
    
Methods Summary
public voiddestroyApp(boolean unconditional)
Destroy cleans up.

param
unconditional is ignored; this object always destroys itself when requested.

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

    
public voidrun()
Remove a MIDlet suite.

        try {
            MIDletSuiteStorage midletSuiteStorage =
                MIDletSuiteStorage.getMIDletSuiteStorage();

            midletSuiteStorage.remove(suiteId);
            System.out.println("Suite removed");
        } catch (MIDletSuiteLockedException msle) {
            System.err.println("Error: MIDlet suite is locked");
        } catch (Throwable t) {
            System.err.println("Error removing suite " + suiteId);
            t.printStackTrace();
        }

        notifyDestroyed();
    
public voidstartApp()
Start.