Methods Summary |
---|
protected void | closeSuite()
super.closeSuite();
// shutdown any preempting
if (displayEventHandler != null) {
displayEventHandler.donePreempting(null);
}
|
protected MIDletSuite | createMIDletSuite()Creates MIDlet suite instance by suite ID
MIDletSuiteStorage storage;
MIDletSuite suite = null;
if (suiteId == MIDletSuite.INTERNAL_SUITE_ID) {
// assume a class name of a MIDlet in the classpath
suite = InternalMIDletSuiteImpl.create(midletDisplayName, suiteId);
} else {
storage = MIDletSuiteStorage.
getMIDletSuiteStorage(internalSecurityToken);
suite = storage.getMIDletSuite(suiteId, false);
Logging.initLogSettings(suiteId);
}
return suite;
|
protected void | createSuiteEnvironment()Creates all needed objects of a MIDlet suite environment, but
only initialization that is done, will be to pass other created objects,
and the current and AMS isolate IDs. It is mostly event-related
objects, however subclasses can extend the environment with more
specific parts
midletControllerEventProducer =
new MIDletControllerEventProducer(
eventQueue,
amsIsolateId,
isolateId);
foregroundController = new CldcForegroundController(
midletControllerEventProducer);
// creates display container, needs foregroundController
super.createSuiteEnvironment();
foregroundEventListener = new ForegroundEventListener(
eventQueue,
displayContainer);
midletStateHandler =
MIDletStateHandler.getMidletStateHandler();
MIDletStateListener midletStateListener =
new CldcMIDletStateListener(internalSecurityToken,
displayContainer,
midletControllerEventProducer);
midletStateHandler.initMIDletStateHandler(
internalSecurityToken,
midletStateListener,
new CldcMIDletLoader(internalSecurityToken),
new CldcPlatformRequest(internalSecurityToken));
midletEventListener = new MIDletEventListener(
internalSecurityToken,
midletStateHandler,
eventQueue);
|
protected static int | getErrorCode(java.lang.Throwable t)Gets error code by exception type
if (t instanceof ClassNotFoundException) {
return Constants.MIDLET_CLASS_NOT_FOUND;
} else if (t instanceof InstantiationException) {
return Constants.MIDLET_INSTANTIATION_EXCEPTION;
} else if (t instanceof IllegalAccessException) {
return Constants.MIDLET_ILLEGAL_ACCESS_EXCEPTION;
} else if (t instanceof OutOfMemoryError) {
return Constants.MIDLET_OUT_OF_MEM_ERROR;
} else if (t instanceof MIDletSuiteLockedException) {
return Constants.MIDLET_INSTALLER_RUNNING;
} else {
return Constants.MIDLET_CONSTRUCTOR_FAILED;
}
|
protected static int | getErrorMessageId(int errorCode)Gets AMS error message ID by generic error code
switch (errorCode) {
case Constants.MIDLET_SUITE_DISABLED:
return ResourceConstants.
AMS_MIDLETSUITELDR_MIDLETSUITE_DISABLED;
case Constants.MIDLET_SUITE_NOT_FOUND:
return ResourceConstants.
AMS_MIDLETSUITELDR_MIDLETSUITE_NOTFOUND;
case Constants.MIDLET_CLASS_NOT_FOUND:
return ResourceConstants.
AMS_MIDLETSUITELDR_CANT_LAUNCH_MISSING_CLASS;
case Constants.MIDLET_INSTANTIATION_EXCEPTION:
return ResourceConstants.
AMS_MIDLETSUITELDR_CANT_LAUNCH_ILL_OPERATION;
case Constants.MIDLET_ILLEGAL_ACCESS_EXCEPTION:
return ResourceConstants.
AMS_MIDLETSUITELDR_CANT_LAUNCH_ILL_OPERATION;
case Constants.MIDLET_OUT_OF_MEM_ERROR:
return ResourceConstants.
AMS_MIDLETSUITELDR_QUIT_OUT_OF_MEMORY;
default:
return ResourceConstants.
AMS_MIDLETSUITELDR_UNEXPECTEDLY_QUIT;
}
|
public void | handleException(java.lang.Throwable t)Handles exception occurred during MIDlet suite execution.
t.printStackTrace();
int errorCode = getErrorCode(t);
reportError(errorCode, t.getMessage());
|
protected void | init()Core initialization of a MIDlet suite loader
isolateId = MIDletSuiteUtils.getIsolateId();
amsIsolateId = MIDletSuiteUtils.getAmsIsolateId();
// Hint VM of startup beginning: system init phase
MIDletSuiteUtils.vmBeginStartUp(isolateId);
super.init();
|
protected void | initSuiteEnvironment()Does all initialization for already created objects of a MIDlet suite
environment. Subclasses can also extend the initialization with
various global system initializations needed for all suites.
super.initSuiteEnvironment();
|
protected void | startSuite()Starts MIDlet suite in the prepared environment
Overrides super method to hint VM of system startup
phase is ended
// Hint VM of startup finish: system init phase
MIDletSuiteUtils.vmEndStartUp(isolateId);
super.startSuite();
|