com.sun.midp.main |
This is root package of the MIDP runtime environment. Classes that initialize the environment, track MIDlet state and load MIDlet suites.
Runtime Environment Components
The Runtime Environment components load and run a MIDlet suite. The native interface to run a suite is contained in the file midp.h. For the Java platform, two methods were added to the MIDletSuiteStorage class. The figure below shows the dependencies of part of the AMS that load a MIDlet suite.
Detailed Design
The top level (main) files and objects of the Runtime Environment component used to launch a MIDlet are listed in the table below.
File or Object |
Description |
midpAMS.h |
Provides the public C interface to start the VM and run a suite. |
MIDletSuiteStorage |
Provides a method to create MIDletSuite objects for installed suites. |
midpInit.c |
Initializes the system dependent resources, including the C heap, persistent storage, and UI system. |
midp_run.c |
Implements the functionality to run a MIDlet suite. Initializes the VM including the class path, fills in the CommandState with information needed by the MIDletSuiteLoader and starts the VM with the MIDletSuiteLoader as the first class. It repeats this process as long as the CommandState contains the name of the next suite to run. |
CommandState |
Passes state to, and receives state from, each VM run by midp_run.c |
MIDletSuite |
Provides the methods the rest of the system requires of a MIDlet suite, such as permission checking and getting application properties. MIDletSuite is an interface. |
InternalMIDletSuiteImpl |
Implements the MIDletSuite interface for internally ROMized MIDlets. |
MIDletStateHandler |
Handles processing of the runtime states of the MIDlets running in an isolated runtime environment. See the com.sun.midp.midlet package for more information. |
MIDletSuiteLoader |
Sets up the system before a suite is run. This is the first class loaded by the VM. It takes the following steps to load and run a suite:
- Distributes security tokens to internal classes that need them
- Initilizes packages that have background processing requirements.
- Gets the CommandState
- Creates a MIDletSuite object for the suite named as the next suite to run in the CommandState and then clears the name in the CommandState
- Loads any arguments in the CommandState into the MIDlet suite's application properties as arg-0, arg-1, and arg-2, then clear the arguments in the CommandState
- Starts the suite and put the status in the CommandState. This is a blocking action that does not return until all of the MIDlets of the suite are destroyed.
- Gets the name of the next suite and the last suite to run from MIDletSuiteStorage and puts them in the CommandState
- Moves the name of the last suite in the CommandState to the name of the next suite to run in the CommandState if there is no next suite to run
- Shuts down the event queue
- Saves the CommandState
- Exits the VM with a special status that is different than the one for a VM abort, so midpRun.cpp knows the VM did not abort
|
The figure below shows the sequence of events that occur in the runtime environment when a MIDlet is launched from the Java Application Manager.
The figure below shows the sequence of events that occur in the runtime environment when a MIDlet is destroyed.
|
Java Source File Name | Type | Comment |
AbstractMIDletSuiteLoader.java | Class | The class presents abstract MIDlet suite loader with routines to prepare
runtime environment for a suite execution. |
AmsUtil.java | Class | Implements utilities that are different for SVM and MVM modes. |
AppIsolateMIDletSuiteLoader.java | Class | The first class loaded in an application Isolate by the MIDP AMS to
initialize internal security and start a MIDlet suite. |
AutoDisplayController.java | Class | |
AutoDisplayControllerListener.java | Interface | |
CdcAccessControlContext.java | Class | |
CDCInit.java | Class | Initialize the CDC environment for MIDlet execution. |
CdcMIDletLoader.java | Class | The class implements the MIDlet loader for the CLDC VM. |
CdcMIDletSuiteLoader.java | Class | The first class loaded in VM by midp_run_midlet_with_args to initialize
internal security the internal AMS classes and start a MIDlet suite. |
CdcPlatformRequest.java | | |
CldcAccessControlContext.java | Class | |
CldcForegroundController.java | Class | This class provides methods to abstract the central foreground control
code from the the LCDUI library. |
CldcMIDletLoader.java | Class | The class implements the MIDlet loader for the CLDC VM. |
CldcMIDletStateListener.java | Class | The class implements the MIDlet state listener for the CLDC VM. |
CldcMIDletSuiteLoader.java | Class | The class presents abstract MIDlet suite loader with routines to prepare
runtime environment for CLDC a suite execution. |
CldcPlatformRequest.java | Class | Implements platform request functionality for CLDC platform. |
CommandState.java | Class | Holds the state for MIDlet Suite management commands. |
Configuration.java | Class | access the implementation configuration file parameters. |
DisplayController.java | Class | This class controls which MIDlet's display is in the foreground. |
DisplayControllerListener.java | Interface | A listener interface for processing DisplayController events. |
DummyNamsMIDlet.java | Class | |
DummyNamsMIDlet1.java | Class | |
DummyNamsMIDlet2.java | Class | |
DummyNamsMIDlet3.java | Class | |
ExecuteMIDletEventListener.java | Class | Handles execute MIDlet events. |
HeadlessAlert.java | Class | HeadlessAlert is shown when a user selects a MIDlet to bring to the
foreground that has not requested the foreground at least once by
call Display.setCurrent(Displayable). |
IndicatorManager.java | Class | IndicatorManager is a singleton class that controls the home icon
status in status bar. |
IsolateMonitor.java | Class | Implements the mechanism to monitor MIDlet suites isolate.
The StartMIDletMonitor provides the isolate references at it gets
a MIDlet create notification from the MIDletProxyList. |
IsolateMonitorListener.java | Interface | Class that need to be notified when suites terminate implement this
interface and implementation to the Isolate monitor. |
MIDletAppImageGenerator.java | Class | This a class stub class to enable the com.sun.midp.installer.Installer
to compile. |
MIDletAppImageGeneratorBase.java | Class | This class is designed to provide the functionality
needed for generating the binary image from the MIDlet suite
classes. |
MIDletControllerEventConsumer.java | Interface | This interface is to be implemnted by an event processing target
for MIDlet events on MIDlet controller (i.e. |
MIDletControllerEventListener.java | Class | Provides initial event processing for MIDletProxyList. |
MIDletControllerEventProducer.java | Class | This class provides methods to send events of types
handled by MIDletControllerEventConsumer I/F implementors.
This class completely hide event construction & sending in its methods.
This class is intended to be used by MIDletStateHandler & MIDletPeer
classes in Allication Isolate.
So in some of its sendXXXEvent()methods we can change int IDs to
MIDletPeer references.
Generic comments for all XXXEventProducers:
For each supported event type there is a separate sendXXXEvent() method,
that gets all needed parameters to construct an event of an approprate class.
The method also performs event sending itself.
If a given event type merges a set of logically different subtypes,
this class shall provide separate methods for these subtypes.
It is assumed that only one object instance of this class
is initialized with the system event that is created at (isolate) startup. |
MIDletExecuteEventProducer.java | Class | This class provides methods to send events of types
handled by MIDletExecuteEventConsumer I/F implementors. |
MIDletProxy.java | Class | Represents the state of a running MIDlet and its Display so that objects
do not have to be shared across Isolates. |
MIDletProxyList.java | Class | Manages a list of MIDlet proxies, each proxy representing a running MIDlet
and tracks which MIDlet has the foreground display, the list only available
to objects running in the AMS isolate.
The list is updated upon receiving events. |
MIDletProxyListListener.java | Interface | A listener interface for processing MIDlet proxy list changes and additions. |
MIDletProxyUtils.java | Class | Utilities for the MIDletProxy. |
MIDletSuiteLoader.java | Class | The first class loaded in VM by midp_run_midlet_with_args to initialize
internal security the internal AMS classes and start a MIDlet suite. |
MIDletSuiteUtils.java | Class | The class designed to provide utils for starting MIDlet suites,
and scheduling their start using VM cycling mechanism. |
MIDletSuiteVerifier.java | Class | This a class stub class to enable the com.sun.midp.installer.Installer
to compile. |
MVMDisplayController.java | Class | This class controls which MIDlet's display is in the foreground. |
NamsAPIWrapper.java | Class | A wrapper for NAMS MIDlet API. |
NamsManager.java | Class | Works as a simple (display) manager to test NAMS. |
NamsNotifier.java | Class | Works as a simple (display) manager to test NAMS. |
NamsStorage.java | Class | A wrapper for NAMS MIDlet API. |
NamsTestService.java | Class | A service for testing the Native AMS (nams). |
NamsTestServiceMidlet.java | Class | A midlet to start NAMS Test Service. |
NativeAppManagerPeer.java | Class | This is an implementation of the native application manager peer
for the MVM mode of VM capable of running with
more than 1 midlet concurrently. |
NativeDisplayControllerPeer.java | Class | This class override the MVM display manager so that requests from its
parent midlet will not be given to the MVM display manager. |
NativeForegroundState.java | Class | This class enables the native foreground state to be changed. |
RuntimeInfo.java | Class | Structure containing the run time information about the midlet. |
SMMDisplayController.java | Class | This class controls which MIDlet's display is in the foreground. |
StartMIDletMonitor.java | Class | Implements the mechanism to monitor the startup of a MIDlet. |
TestMIDletControllerEventProducer.java | Class | Unit tests for the MIDletControllerEventProducer class. |
TestNamsStartMidlet.java | Class | |
TrustedMIDletIcon.java | Class | This holds the trusted MIDlet icon. |