Java Doc for MIDletProxyList.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » main » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.midp.main 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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  intPROXY_ADDED
     MIDletProxy added constant.
final static  intPROXY_REMOVED
     MIDletProxy removed constant.

Constructor Summary
 MIDletProxyList(EventQueue eventQueue)
     Package private constructor.

Method Summary
public  voidaddListener(MIDletProxyListListener listener)
     Add a listener for MIDlet proxy list changes.
public  MIDletProxyfindAmsProxy()
     Retireves proxy whose peer application runs in the AMS isolate.
public  MIDletProxyfindMIDletProxy(int suiteId, String classname)
     Find the MIDletProxy that has matching suiteId and classname.
public  MIDletProxyfindMIDletProxy(int externalAppId)
     Find the MIDletProxy that has matching external app ID.
public  MIDletProxygetForegroundMIDlet()
     Get the foreground MIDlet.
public static  MIDletProxyListgetMIDletProxyList()
     Get a reference to the MIDlet proxy list in a secure way.
public static  MIDletProxyListgetMIDletProxyList(SecurityToken token)
     Get a reference to the MIDlet proxy list in a secure way.
public  EnumerationgetMIDlets()
     Get an enumeration of MIDlet proxies.
public  voidhandleActivateAllEvent()
     Process an ACTIVATE_ALL_EVENT.
public  voidhandleDestroyAllEvent()
     Process a SHUTDOWN_ALL_EVENT. MIDletControllerEventConsumer I/F method. It simply calls "shutdown()".
public  voidhandleDisplayBackgroundRequestEvent(int midletIsolateId, int midletDisplayId)
     Process a background request event.
public  voidhandleDisplayCreateNotifyEvent(int midletIsolateId, int midletDisplayId, String midletClassName)
     Process a Display created notification.
public  voidhandleDisplayForegroundRequestEvent(int midletIsolateId, int midletDisplayId, boolean isAlert)
     Process a foreground request event.
public  voidhandleDisplayPreemptStartEvent(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  voidhandleDisplayPreemptStopEvent(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  voidhandleFatalErrorNotifyEvent(int midletIsolateId, int midletDisplayId)
     Processes FATAL_ERROR_NOTIFICATION.
public  voidhandleMIDletActiveNotifyEvent(int midletSuiteId, String midletClassName)
     Process a MIDlet active notification MIDletControllerEventConsumer I/F method.
public  voidhandleMIDletCreateNotifyEvent(int midletSuiteId, String midletClassName, int midletIsolateId, int midletExternalAppId, String midletDisplayName)
     Process a MIDlet created notification.
public  voidhandleMIDletDestroyNotifyEvent(int midletSuiteId, String midletClassName)
     Process a MIDlet destroyed event.
public  voidhandleMIDletDestroyRequestEvent(int midletIsolateId, int midletDisplayId)
     Process a MIDlet destroy request event.
public  voidhandleMIDletForegroundSelectEvent(int onlyFromLaunched)
     Process a select foreground event by putting the foreground selector MIDlet in the foreground.
public  voidhandleMIDletForegroundTransferEvent(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  voidhandleMIDletPauseNotifyEvent(int midletSuiteId, String midletClassName)
     Process a MIDlet paused notification.
public  voidhandleMIDletResumeRequestEvent(int midletSuiteId, String midletClassName)
     Processes a MIDLET_RESUME_REQUEST event.
public  voidhandleMIDletRsPauseNotifyEvent(int midletSuiteId, String midletClassName)
     Handles notification event of MIDlet resources pause.
public  voidhandleMIDletStartErrorEvent(int midletSuiteId, String midletClassName, int midletExternalAppId, int errorCode, String errorDetails)
     Process a MIDlet start error event.
public  voidhandlePauseAllEvent()
     Process a PAUSE_ALL_EVENT.
public  voidhandleSetForegroundByNameRequestEvent(int suiteId, String className)
     Processes SET_FOREGROUND_BY_NAME_REQUEST event.
static  voidinitClass(MIDletProxyList theMIDletProxyList)
     Called by the MIDlet suite loader in AMS Isolate to intialize the midletProxy list.
public  booleanisAlertWaitingInBackground()
    
public  booleanisMidletInList(int id, String className)
     Check to see if the MIDlet is already started.
public  voidmidpResumed()
     Called to notify that java side of MIDP system has been resumed.
public  voidmidpSuspended()
     Called to notify that java side of MIDP system has been suspended.
 voidnotifyListenersOfProxyListChange(MIDletProxy midletProxy, int notificationType)
     Notify the listeners of change in the size of the proxy list.
 voidnotifyListenersOfProxyUpdate(MIDletProxy midletProxy, int reason)
     Notify the listeners of the midletProxy list that a proxy has been updated.
 voidremoveIsolateProxies(int id)
    
public  voidremoveListener(MIDletProxyListListener listener)
     Remove a listener for MIDlet proxy list changes.
 voidremoveMidletProxy(MIDletProxy midletProxy)
    
public  voidsetDisplayController(DisplayController newController)
     Enables the display controller to be replaced by an application manager.
public  voidsetForegroundMIDlet(MIDletProxy newForeground)
     Sets the foreground MIDlet.
public  voidshutdown()
     Shutdown the system by asynchronously destroying all MIDlets.
static  booleanshutdownInProgress()
    
public  voidterminatePauseAll()
     Finalizes PAUSE_ALL_EVENT processing after timeout for pausing MIDlets expires.
public  voidwaitForShutdownToComplete()
     Wait for the system to asynchronously destroy all MIDlets.

Field Detail
PROXY_ADDED
final static int PROXY_ADDED(Code)
MIDletProxy added constant.



PROXY_REMOVED
final static int PROXY_REMOVED(Code)
MIDletProxy removed constant.




Constructor Detail
MIDletProxyList
MIDletProxyList(EventQueue eventQueue)(Code)
Package private constructor. Shall be called from MIDletSuiteLoader's main()
Parameters:
  eventQueue - reference to the event queue




Method Detail
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.



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.