/**
   * Creates MIDlet suite instance by suite ID
   *
   * @return MIDlet suite to load
   * @throws Exception in the case MIDlet suite can not be created because of a security reasons or
   *     some problems related to suite storage
   */
  protected MIDletSuite createMIDletSuite() throws Exception {
    MIDletSuiteStorage storage;
    MIDletSuite suite = null;

    storage = MIDletSuiteStorage.getMIDletSuiteStorage(internalSecurityToken);

    if (suiteId == MIDletSuite.INTERNAL_SUITE_ID) {
      // assume a class name of a MIDlet in the classpath
      suite = InternalMIDletSuiteImpl.create(storage, midletDisplayName, suiteId);
    } else {
      suite = storage.getMIDletSuite(suiteId, false);
      Logging.initLogSettings(suiteId);
    }

    return suite;
  }
  /** Creates environment objects needed to AMS task */
  protected void createSuiteEnvironment() {
    foregroundController = this;

    lcduiEnvironment =
        new LCDUIEnvironmentForCDC(
            internalSecurityToken, eventQueue, isolateId, foregroundController);
    foregroundEventProducer = new CdcForegroundEventProducer(eventQueue);

    // creates display container, needs foregroundController
    super.createSuiteEnvironment();

    midletStateHandler = MIDletStateHandler.getMidletStateHandler();

    MIDletSuiteStorage mss = MIDletSuiteStorage.getMIDletSuiteStorage(internalSecurityToken);

    midletStateHandler.initMIDletStateHandler(
        internalSecurityToken, this, new CdcMIDletLoader(mss), this);

    MidletSuiteContainer msc = new MidletSuiteContainer(mss);

    RmsEnvironment.init(internalSecurityToken, msc);
  }