FileDocCategorySizeDatePackage
CldcMIDletLoader.javaAPI DocphoneME MR2 API (J2ME)2578Wed May 02 18:00:06 BST 2007com.sun.midp.main

CldcMIDletLoader

public class CldcMIDletLoader extends Object implements MIDletLoader
The class implements the MIDlet loader for the CLDC VM.

Fields Summary
private com.sun.midp.security.SecurityToken
classSecurityToken
This class has a different security domain than the application.
Constructors Summary
CldcMIDletLoader(com.sun.midp.security.SecurityToken token)
Initializes this object.

param
token security token for this class.

        classSecurityToken = token;
    
Methods Summary
public MIDletnewInstance(MIDletSuite suite, java.lang.String className)
Loads a MIDlet from a suite's JAR.

param
suite reference to the suite
param
className class name of the MIDlet to be created
return
new instance of a MIDlet
exception
ClassNotFoundException if the MIDlet class is not found
exception
InstantiationException if the MIDlet cannot be created or is not subclass of MIDlet
exception
IllegalAccessException if the MIDlet is not permitted to perform a specific operation

        Class midletClass;

        midletClass = Class.forName(className);
        if (!MIDlet.class.isAssignableFrom(midletClass)) {
            throw new InstantiationException("Class not a MIDlet");
        }

        return (MIDlet)midletClass.newInstance();