| java.lang.Object com.sun.midp.main.MIDletProxyList
MIDletProxyList | public class MIDletProxyList implements MIDletControllerEventConsumer,SuspendSystemListener(Code) | | 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. See the process method for event
processing.
Objects can listen (see MIDletProxyListListener) to the list for additions,
updates to proxies, and removals as will as set foreground events and
select foreground events.
This class also provides a shutdown method and processes a shutdown event
to enable the method be used by native code.
|
Field Summary | |
final static int | PROXY_ADDED MIDletProxy added constant. | final static int | PROXY_REMOVED MIDletProxy removed constant. |
Constructor Summary | |
| MIDletProxyList(EventQueue eventQueue) Package private constructor. |
Method Summary | |
public void | addListener(MIDletProxyListListener listener) Add a listener for MIDlet proxy list changes. | public MIDletProxy | findAmsProxy() Retireves proxy whose peer application runs in the AMS isolate. | public MIDletProxy | findMIDletProxy(int suiteId, String classname) Find the MIDletProxy that has matching suiteId and classname. | public MIDletProxy | findMIDletProxy(int externalAppId) Find the MIDletProxy that has matching external app ID. | public MIDletProxy | getForegroundMIDlet() Get the foreground MIDlet. | public static MIDletProxyList | getMIDletProxyList() Get a reference to the MIDlet proxy list in a secure way. | public static MIDletProxyList | getMIDletProxyList(SecurityToken token) Get a reference to the MIDlet proxy list in a secure way. | public Enumeration | getMIDlets() Get an enumeration of MIDlet proxies. | public void | handleActivateAllEvent() Process an ACTIVATE_ALL_EVENT. | public void | handleDestroyAllEvent() Process a SHUTDOWN_ALL_EVENT.
MIDletControllerEventConsumer I/F method.
It simply calls "shutdown()". | public void | handleDisplayBackgroundRequestEvent(int midletIsolateId, int midletDisplayId) Process a background request event. | public void | handleDisplayCreateNotifyEvent(int midletIsolateId, int midletDisplayId, String midletClassName) Process a Display created notification. | public void | handleDisplayForegroundRequestEvent(int midletIsolateId, int midletDisplayId, boolean isAlert) Process a foreground request event. | public void | handleDisplayPreemptStartEvent(int midletIsolateId, int midletDisplayId) Process a "display preempt start" event.
Set the foreground to a given display if a certain display
has the foreground. | public void | handleDisplayPreemptStopEvent(int midletIsolateId, int midletDisplayId) Process a "display preempt stop" event.
Set the foreground to a given display if a certain display
has the foreground. | public void | handleFatalErrorNotifyEvent(int midletIsolateId, int midletDisplayId) Processes FATAL_ERROR_NOTIFICATION. | public void | handleMIDletActiveNotifyEvent(int midletSuiteId, String midletClassName) Process a MIDlet active notification
MIDletControllerEventConsumer I/F method. | public void | handleMIDletCreateNotifyEvent(int midletSuiteId, String midletClassName, int midletIsolateId, int midletExternalAppId, String midletDisplayName) Process a MIDlet created notification. | public void | handleMIDletDestroyNotifyEvent(int midletSuiteId, String midletClassName) Process a MIDlet destroyed event. | public void | handleMIDletDestroyRequestEvent(int midletIsolateId, int midletDisplayId) Process a MIDlet destroy request event. | public void | handleMIDletForegroundSelectEvent(int onlyFromLaunched) Process a select foreground event by putting the foreground selector
MIDlet in the foreground. | public void | handleMIDletForegroundTransferEvent(int originMIDletSuiteId, String originMIDletClassName, int targetMIDletSuiteId, String targetMIDletClassName) Process an event to transition the foreground from a current display
to a target MIDlet by ID and classname. | public void | handleMIDletPauseNotifyEvent(int midletSuiteId, String midletClassName) Process a MIDlet paused notification. | public void | handleMIDletResumeRequestEvent(int midletSuiteId, String midletClassName) Processes a MIDLET_RESUME_REQUEST event. | public void | handleMIDletRsPauseNotifyEvent(int midletSuiteId, String midletClassName) Handles notification event of MIDlet resources pause. | public void | handleMIDletStartErrorEvent(int midletSuiteId, String midletClassName, int midletExternalAppId, int errorCode, String errorDetails) Process a MIDlet start error event. | public void | handlePauseAllEvent() Process a PAUSE_ALL_EVENT. | public void | handleSetForegroundByNameRequestEvent(int suiteId, String className) Processes SET_FOREGROUND_BY_NAME_REQUEST event. | static void | initClass(MIDletProxyList theMIDletProxyList) Called by the MIDlet suite loader in AMS Isolate to intialize the
midletProxy list. | public boolean | isAlertWaitingInBackground() | public boolean | isMidletInList(int id, String className) Check to see if the MIDlet is already started. | public void | midpResumed() Called to notify that java side of MIDP system has been resumed. | public void | midpSuspended() Called to notify that java side of MIDP system has been suspended. | void | notifyListenersOfProxyListChange(MIDletProxy midletProxy, int notificationType) Notify the listeners of change in the size of the proxy list. | void | notifyListenersOfProxyUpdate(MIDletProxy midletProxy, int reason) Notify the listeners of the midletProxy list that a proxy
has been updated. | void | removeIsolateProxies(int id) | public void | removeListener(MIDletProxyListListener listener) Remove a listener for MIDlet proxy list changes. | void | removeMidletProxy(MIDletProxy midletProxy) | public void | setDisplayController(DisplayController newController) Enables the display controller to be replaced by an application
manager. | public void | setForegroundMIDlet(MIDletProxy newForeground) Sets the foreground MIDlet. | public void | shutdown() Shutdown the system by asynchronously destroying all MIDlets. | static boolean | shutdownInProgress() | public void | terminatePauseAll() Finalizes PAUSE_ALL_EVENT processing after timeout for
pausing MIDlets expires. | public void | waitForShutdownToComplete() Wait for the system to asynchronously destroy all MIDlets. |
PROXY_ADDED | final static int PROXY_ADDED(Code) | | MIDletProxy added constant.
|
PROXY_REMOVED | final static int PROXY_REMOVED(Code) | | MIDletProxy removed constant.
|
MIDletProxyList | MIDletProxyList(EventQueue eventQueue)(Code) | | Package private constructor.
Shall be called from MIDletSuiteLoader's main()
Parameters: eventQueue - reference to the event queue |
addListener | public void addListener(MIDletProxyListListener listener)(Code) | | Add a listener for MIDlet proxy list changes.
Parameters: listener - MIDlet proxy list listener |
findAmsProxy | public MIDletProxy findAmsProxy()(Code) | | Retireves proxy whose peer application runs in the AMS isolate.
The proxy is identified by isolate ID since only one application
can run in the AMS solate.
the proxy or null if one cannot be found |
findMIDletProxy | public MIDletProxy findMIDletProxy(int suiteId, String classname)(Code) | | Find the MIDletProxy that has matching suiteId and classname.
Parameters: suiteId - the suiteId of the target application Parameters: classname - classname of the MIDlet a reference to the matching MIDletProxy or null if no match |
findMIDletProxy | public MIDletProxy findMIDletProxy(int externalAppId)(Code) | | Find the MIDletProxy that has matching external app ID.
Parameters: externalAppId - ID assigned by the external application manager a reference to the matching MIDletProxy or null if no match |
getForegroundMIDlet | public MIDletProxy getForegroundMIDlet()(Code) | | Get the foreground MIDlet.
proxy to the MIDlet that is in the foreground |
getMIDletProxyList | public static MIDletProxyList getMIDletProxyList()(Code) | | Get a reference to the MIDlet proxy list in a secure way.
The calling suite must have the com.sun.midp.ams permission "allowed".
Should only be called in the AMS Isolate.
MIDP MIDlet proxy list reference |
getMIDletProxyList | public static MIDletProxyList getMIDletProxyList(SecurityToken token)(Code) | | Get a reference to the MIDlet proxy list in a secure way.
The calling suite must have the com.sun.midp.ams permission "allowed".
Should only be called in the AMS Isolate.
Parameters: token - SecurityToken with the AMS permission allowed ornull to use the midletSuite permission MIDP MIDlet proxy list reference |
getMIDlets | public Enumeration getMIDlets()(Code) | | Get an enumeration of MIDlet proxies.
enumeration of midletProxys |
handleActivateAllEvent | public void handleActivateAllEvent()(Code) | | Process an ACTIVATE_ALL_EVENT.
MIDletControllerEventConsumer I/F method.
|
handleDestroyAllEvent | public void handleDestroyAllEvent()(Code) | | Process a SHUTDOWN_ALL_EVENT.
MIDletControllerEventConsumer I/F method.
It simply calls "shutdown()". In future it shall be merged with
"shutdown()" and substitute it.
|
handleDisplayBackgroundRequestEvent | public void handleDisplayBackgroundRequestEvent(int midletIsolateId, int midletDisplayId)(Code) | | Process a background request event.
MIDletControllerEventConsumer I/F method.
TBD: param midletProxy proxy with information about MIDlet
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display |
handleDisplayCreateNotifyEvent | public void handleDisplayCreateNotifyEvent(int midletIsolateId, int midletDisplayId, String midletClassName)(Code) | | Process a Display created notification.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display Parameters: midletClassName - Class name of the MIDlet that owns the display |
handleDisplayForegroundRequestEvent | public void handleDisplayForegroundRequestEvent(int midletIsolateId, int midletDisplayId, boolean isAlert)(Code) | | Process a foreground request event.
MIDletControllerEventConsumer I/F method.
TBD: param midletProxy proxy with information about MIDlet
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display Parameters: isAlert - true if the current displayable is an Alert |
handleDisplayPreemptStartEvent | public void handleDisplayPreemptStartEvent(int midletIsolateId, int midletDisplayId)(Code) | | Process a "display preempt start" event.
Set the foreground to a given display if a certain display
has the foreground. Used to start preempting.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display |
handleDisplayPreemptStopEvent | public void handleDisplayPreemptStopEvent(int midletIsolateId, int midletDisplayId)(Code) | | Process a "display preempt stop" event.
Set the foreground to a given display if a certain display
has the foreground. Used to end preempting.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display |
handleFatalErrorNotifyEvent | public void handleFatalErrorNotifyEvent(int midletIsolateId, int midletDisplayId)(Code) | | Processes FATAL_ERROR_NOTIFICATION.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending isolate Parameters: midletDisplayId - ID of the sending Display |
handleMIDletActiveNotifyEvent | public void handleMIDletActiveNotifyEvent(int midletSuiteId, String midletClassName)(Code) | | Process a MIDlet active notification
MIDletControllerEventConsumer I/F method.
TBD: param midletProxy proxy with information about MIDlet
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletCreateNotifyEvent | public void handleMIDletCreateNotifyEvent(int midletSuiteId, String midletClassName, int midletIsolateId, int midletExternalAppId, String midletDisplayName)(Code) | | Process a MIDlet created notification.
MIDletControllerEventConsumer I/F method.
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet Parameters: midletIsolateId - isolate ID of the sending MIDlet Parameters: midletExternalAppId - ID of given by an external applicationmanager Parameters: midletDisplayName - name to show the user |
handleMIDletDestroyNotifyEvent | public void handleMIDletDestroyNotifyEvent(int midletSuiteId, String midletClassName)(Code) | | Process a MIDlet destroyed event.
MIDletControllerEventConsumer I/F method.
TBD: param midletProxy proxy with information about MIDlet
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletDestroyRequestEvent | public void handleMIDletDestroyRequestEvent(int midletIsolateId, int midletDisplayId)(Code) | | Process a MIDlet destroy request event.
MIDletControllerEventConsumer I/F method.
TBD: param midletProxy proxy with information about MIDlet
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display |
handleMIDletForegroundSelectEvent | public void handleMIDletForegroundSelectEvent(int onlyFromLaunched)(Code) | | Process a select foreground event by putting the foreground selector
MIDlet in the foreground.
MIDletControllerEventConsumer I/F method.
|
handleMIDletForegroundTransferEvent | public void handleMIDletForegroundTransferEvent(int originMIDletSuiteId, String originMIDletClassName, int targetMIDletSuiteId, String targetMIDletClassName)(Code) | | Process an event to transition the foreground from a current display
to a target MIDlet by ID and classname. If the source display
does not currently own the foreground the request is ignored.
If the target MIDlet is found in the active list then it it set
as the foreground. If not found, then it should be added as
the next display to get the foreground (when it asks).
MIDletControllerEventConsumer I/F method.
Parameters: originMIDletSuiteId - ID of MIDlet from whichto take forefround ownership away, Parameters: originMIDletClassName - Name of MIDlet from whichto take forefround ownership away Parameters: targetMIDletSuiteId - ID of MIDletto give forefround ownership to, Parameters: targetMIDletClassName - Name of MIDletto give forefround ownership to |
handleMIDletPauseNotifyEvent | public void handleMIDletPauseNotifyEvent(int midletSuiteId, String midletClassName)(Code) | | Process a MIDlet paused notification.
MIDletControllerEventConsumer I/F method.
TBD: param midletProxy proxy with information about MIDlet
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletResumeRequestEvent | public void handleMIDletResumeRequestEvent(int midletSuiteId, String midletClassName)(Code) | | Processes a MIDLET_RESUME_REQUEST event.
MIDletControllerEventConsumer I/F method.
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletRsPauseNotifyEvent | public void handleMIDletRsPauseNotifyEvent(int midletSuiteId, String midletClassName)(Code) | | Handles notification event of MIDlet resources pause.
MIDletControllerEventConsumer I/F method.
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletStartErrorEvent | public void handleMIDletStartErrorEvent(int midletSuiteId, String midletClassName, int midletExternalAppId, int errorCode, String errorDetails)(Code) | | Process a MIDlet start error event.
Notify from last to first added to allow the listener to
remove itself without causing a missed notification.
MIDletControllerEventConsumer I/F method.
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet Parameters: midletExternalAppId - ID of given by an external applicationmanager Parameters: errorCode - start error code Parameters: errorDetails - start error details |
handlePauseAllEvent | public void handlePauseAllEvent()(Code) | | Process a PAUSE_ALL_EVENT.
MIDletControllerEventConsumer I/F method.
|
handleSetForegroundByNameRequestEvent | public void handleSetForegroundByNameRequestEvent(int suiteId, String className)(Code) | | Processes SET_FOREGROUND_BY_NAME_REQUEST event.
Set specified MIDlet to foreground.
Parameters: suiteId - MIDlet's suite ID Parameters: className - MIDlet's class name |
initClass | static void initClass(MIDletProxyList theMIDletProxyList)(Code) | | Called by the MIDlet suite loader in AMS Isolate to intialize the
midletProxy list. Shall be called only by MIDletSuiteLoader's main().
Parameters: theMIDletProxyList - proxy list instance to be usedas MIDlet controller containerShould only be called in the AMS Isolate. |
isAlertWaitingInBackground | public boolean isAlertWaitingInBackground()(Code) | | Return true if home indicator needs to be turned on
true if any MIDlet has set an Alert as the current displayablewhile in the background, otherwise false |
isMidletInList | public boolean isMidletInList(int id, String className)(Code) | | Check to see if the MIDlet is already started.
Parameters: id - Suite ID of the MIDlet Parameters: className - Class name of the MIDlet true if the MIDlet has been started |
midpResumed | public void midpResumed()(Code) | | Called to notify that java side of MIDP system has been resumed.
|
midpSuspended | public void midpSuspended()(Code) | | Called to notify that java side of MIDP system has been suspended.
|
notifyListenersOfProxyListChange | void notifyListenersOfProxyListChange(MIDletProxy midletProxy, int notificationType)(Code) | | Notify the listeners of change in the size of the proxy list.
Notify from last to first added to allow the listener to
remove itself without causing a missed notification.
Parameters: midletProxy - midletProxy that was added or removed in the list Parameters: notificationType - type of change, added or removed |
notifyListenersOfProxyUpdate | void notifyListenersOfProxyUpdate(MIDletProxy midletProxy, int reason)(Code) | | Notify the listeners of the midletProxy list that a proxy
has been updated.
Notify from last to first added to allow the listener to
remove itself without causing a missed notification.
Parameters: midletProxy - midletProxy that changed in the list Parameters: reason - reason for the change |
removeIsolateProxies | void removeIsolateProxies(int id)(Code) | | Removes the MIDletproxies that belong to the isolate id
Parameters: id - IsolateId |
removeListener | public void removeListener(MIDletProxyListListener listener)(Code) | | Remove a listener for MIDlet proxy list changes.
Parameters: listener - MIDlet proxy list listener |
removeMidletProxy | void removeMidletProxy(MIDletProxy midletProxy)(Code) | | Removes a MidletProxy from the MidletProxyList
Parameters: midletProxy - the MIDletProxy to be removed. |
setDisplayController | public void setDisplayController(DisplayController newController)(Code) | | Enables the display controller to be replaced by an application
manager.
Parameters: newController - new display controller |
setForegroundMIDlet | public void setForegroundMIDlet(MIDletProxy newForeground)(Code) | | Sets the foreground MIDlet. If the given midletProxy is paused,
then it will be activated before given the foreground.
the internal system property "pause_app_in_background" is true,
then previous foreground MIDlet will be paused.
The follow steps are performed when changed:
1. Send an event to notify the old foreground Display it has lost the
foreground
2. Change the foreground field in this object and in the native
code.
3. Send an event to notify the new foreground Display is has gained the
foreground
Parameters: newForeground - Proxy of the MIDlet to be put in the foreground |
shutdown | public void shutdown()(Code) | | Shutdown the system by asynchronously destroying all MIDlets.
|
shutdownInProgress | static boolean shutdownInProgress()(Code) | | Returns shutdown status
true if shutdown is in progress, else false |
terminatePauseAll | public void terminatePauseAll()(Code) | | Finalizes PAUSE_ALL_EVENT processing after timeout for
pausing MIDlets expires.
|
waitForShutdownToComplete | public void waitForShutdownToComplete()(Code) | | Wait for the system to asynchronously destroy all MIDlets.
|
|
|