Fields Summary |
---|
private SecurityToken | internalSecurityTokenThis class has a different security domain than the MIDlet suite |
private boolean | appStartedTrue, if an app has been started. |
private DisplayEventHandler | displayEventHandlerProvides interface for display preemption, creation and other
functionality that can not be publicly added to a javax package. |
private DisplayContainer | displayContainerStores array of active displays for a MIDlet suite isolate. |
private MIDletSuiteStorage | suiteStorageReference to the suite storage. |
private MIDletStateHandler | midletStateHandlerStarts and controls MIDlets through the lifecycle states. |
private MIDletSuite | midletSuiteMIDlet suite instance created and properly initialized for
a MIDlet suite invocation. |
private String | midletClassNameName of the class to start MIDlet suite execution |
private int | currentDisplayIdHolds the ID of the current display, for preempting purposes. |
Methods Summary |
---|
public void | destroyApp(int appId, boolean force)Call a MIDlet's destroyApp method.
This method will not return until after the the MIDlet's startApp
method has returned.
If force = false and the app did not get destroyed,
then a RuntimeException must be thrown.
// IMPL_NOTE: force=false is not supported.
try {
MIDletEventConsumer mec =
midletStateHandler.getMIDletEventConsumer(
internalSecurityToken, midletClassName);
if (mec == null) {
return;
}
// IMPL_NOTE: This asynchronous call should be synchronous.
mec.handleMIDletDestroyEvent();
} catch (Exception e) {
e.printStackTrace();
}
|
public boolean | dispatch(java.lang.String URL)
throw new ConnectionNotFoundException("not implemented");
|
public void | handleException(java.lang.Throwable t)Handles exception occurred during MIDlet suite execution.
t.printStackTrace();
|
public void | midletActivated(MIDletSuite suite, javax.microedition.midlet.MIDlet midlet)Called after a MIDlet is successfully activated. This is after
the startApp method is called.
This implementation does nothing.
|
public void | midletCreated(MIDletSuite suite, java.lang.String className, int externalAppId)Called after a MIDlet is successfully created.
This implementation does nothing.
|
public void | midletDestroyed(MIDletSuite suite, java.lang.String className)Called after a MIDlet is successfully destroyed.
This implementation does nothing.
// IMPL_NOTE: The JUMPApplication API does not support this.
|
public void | midletPaused(MIDletSuite suite, java.lang.String className)Called after a MIDlet is successfully paused.
This implementation does nothing.
|
public void | midletPausedItself(MIDletSuite suite, java.lang.String className)Called after a MIDlet pauses itself. In this case pauseApp has
not been called.
// IMPL_NOTE: The JUMPApplication API does not support this.
|
public void | midletPreStart(MIDletSuite suite, java.lang.String className)Called before a MIDlet is created.
This implementation does nothing.
|
public void | pauseApp(int appId)Call a MIDlet's pauseApp method.
This method will not return until after the the MIDlet's pauseApp
method has returned.
try {
MIDletEventConsumer mec =
midletStateHandler.getMIDletEventConsumer(
internalSecurityToken, midletClassName);
if (mec == null) {
return;
}
// IMPL_NOTE: This asynchronous call should be synchronous.
mec.handleMIDletPauseEvent();
} catch (Exception e) {
e.printStackTrace();
}
|
public void | preActivated(MIDletSuite suite, java.lang.String className)Called before a MIDlet is activated.
This implementation does nothing.
|
public javax.microedition.lcdui.Displayable | registerDisplay(int displayId, java.lang.String ownerClassName)Called to register a newly create Display. Must method must
be called before the other methods can be called.
This implementation does nothing.
currentDisplayId = displayId;
return null;
|
public void | requestBackground(int displayId)Called to request the background.
This implementation does nothing.
ForegroundEventConsumer fc =
displayContainer.findForegroundEventConsumer(displayId);
if (fc == null) {
return;
}
fc.handleDisplayBackgroundNotifyEvent();
|
public void | requestForeground(int displayId, boolean isAlert)Called to request the foreground.
This implementation does nothing.
ForegroundEventConsumer fc =
displayContainer.findForegroundEventConsumer(displayId);
if (fc == null) {
return;
}
setForegroundInNativeState(displayId);
fc.handleDisplayForegroundNotifyEvent();
|
public void | resumeApp(int appId)Call a MIDlet's startApp method.
This method will not return until after the the MIDlet's startApp
method has returned.
try {
MIDletEventConsumer mec =
midletStateHandler.getMIDletEventConsumer(
internalSecurityToken, midletClassName);
if (mec == null) {
return;
}
// IMPL_NOTE: This asynchronous call should be synchronous.
mec.handleMIDletActivateEvent();
} catch (Exception e) {
e.printStackTrace();
}
|
public void | resumeRequest(MIDletSuite suite, java.lang.String className)Called when a MIDlet calls MIDlet resume request.
MIDletEventConsumer mec =
midletStateHandler.getMIDletEventConsumer(internalSecurityToken,
className);
// IMPL_NOTE: The JUMPApplication API does not support this.
if (mec == null) {
return;
}
mec.handleMIDletActivateEvent();
|
public void | run()Run the MIDletStateHandler.
try {
midletStateHandler.startSuite(this, midletSuite, 0,
midletClassName);
midletSuite.close();
} catch (Throwable t) {
t.printStackTrace();
} finally {
System.exit(0);
}
|
private native void | setForegroundInNativeState(int displayId)Set foreground display native state, so the native code will know
which display can draw. This method will not be needed when
JUMP uses GCI.
|
public synchronized int | startApp(com.sun.jump.common.JUMPApplication app, java.lang.String[] args)Create a MIDlet and call its startApp method.
This method will not return until after the the MIDlet's startApp
method has returned.
try {
int suiteId;
if (appStarted) {
throw new
IllegalStateException("Attempt to start a second app");
}
appStarted = true;
suiteId = MIDletApplication.getMIDletSuiteID(app);
midletSuite = suiteStorage.getMIDletSuite(suiteId, false);
if (midletSuite == null) {
throw new IllegalArgumentException("Suite not found");
}
Logging.initLogSettings(suiteId);
if (!midletSuite.isEnabled()) {
throw new IllegalStateException("Suite is disabled");
}
displayEventHandler.initSuiteData(midletSuite.isTrusted());
// set a each arg as property numbered from 0, first arg: "arg-0"
if (args != null) {
for (int i = 0; i < args.length; i++) {
if (args[i] != null) {
midletSuite.setTempProperty(internalSecurityToken,
"arg-" + i, args[i]);
}
}
}
midletClassName = MIDletApplication.getMIDletClassName(app);
// IMPL_NOTE: This asynchronous call should be synchronous.
new Thread(this).start();
} catch (Exception e) {
e.printStackTrace();
return -1;
}
//DEBUG:System.err.println("**started");
return 1; // only one app can run in this container at a time
|
public void | startPreempting(int displayId)Called to start preempting. The given display will preempt all other
displays for this isolate.
requestBackground(currentDisplayId);
requestForeground(displayId, true);
|
public void | stopPreempting(int displayId)Called to end preempting.
requestBackground(displayId);
requestForeground(currentDisplayId, false);
|