FileDocCategorySizeDatePackage
MIDletProxyUtils.javaAPI DocphoneME MR2 API (J2ME)3451Wed May 02 18:00:08 BST 2007com.sun.midp.main

MIDletProxyUtils

public class MIDletProxyUtils extends Object
Utilities for the MIDletProxy. Does nothing is SVM mode.

Fields Summary
Constructors Summary
Methods Summary
static com.sun.cldc.isolate.IsolategetIsolateFromId(int id)
Get the Isolate from a MIDletProxy's IsolateId

param
id MIDletProxy's Isolate Id
return
MIDletProxy's Isolate

        if (id > 1) {
            Isolate[] isolate = Isolate.getIsolates();
            for (int i = 0; i < isolate.length; i++) {
                if (isolate[i].id() == id) {
                    return isolate[i];
                }
            }
        }
        return null;
    
public static voidminPriority(MIDletProxy mp)
Set the MIDletProxy to run with the Minimum Isolate Priority

param
mp MIDletProxy

        Isolate isolate = getIsolateFromId(mp.getIsolateId());
        if (isolate != null) {
            isolate.setPriority(Isolate.MIN_PRIORITY);
        }
    
public static voidnormalPriority(MIDletProxy mp)
Set the MIDletProxy to run with the Normal Isolate Priority

param
mp MIDletProxy

        Isolate isolate = getIsolateFromId(mp.getIsolateId());
        if (isolate != null) {
          isolate.setPriority(Isolate.NORM_PRIORITY);
        }
    
static voidterminateMIDletIsolate(MIDletProxy mp, MIDletProxyList mpl)
Terminates an isolate correspondent to the proxy given, resets proxy termination timer and invokes proper proxy list updates. Waits for termination completion.

param
mp MIDlet proxy for the isolate to be terminated
param
mpl the MIDlet proxy list

        Isolate isolate = getIsolateFromId(mp.getIsolateId());
         if (isolate != null) {
            mp.setTimer(null);
            isolate.exit(0);
            // IMPL_NOTE: waiting for termination completion may be useless.
            isolate.waitForExit();
            mpl.removeIsolateProxies(mp.getIsolateId());
        }