Java Doc for MIDletPeer.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » midlet » 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.midlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.midlet.MIDletPeer

MIDletPeer
public class MIDletPeer implements MIDletEventConsumer(Code)
MIDletPeer maintains the current state of the MIDlet and forwards updates to it. It contains references to the MIDlet itself and to its corresponding Display instance. Control methods (startApp, destroyApp, pauseApp) defined here are invoked on the MIDlet object via the MIDletTunnel.

All state changes are synchronized using midletStateHandler retrieved from the MIDletStateHandler. NotifyPaused, ResumeRequest, and NotifyDestroyed methods invoked on the MIDlet cause the appropriate state change. The MIDletStateHandler is aware of changes by waiting on the midletStateHandler.



Field Summary
final public static  intACTIVE
    
final static  intACTIVE_PENDING
    
final public static  intDESTROYED
    
final static  intDESTROY_PENDING
    
final public static  intPAUSED
    
final static  intPAUSE_PENDING
    
protected  MIDletmidlet
     The MIDlet for which this is the state.

Constructor Summary
 MIDletPeer()
     Creates a MIDlet's peer which is registered the MIDletStateHandler.

Method Summary
public  intcheckPermission(String permission)
     Get the status of the specified permission. If no API on the device defines the specific permission requested then it must be reported as denied. If the status of the permission is not known because it might require a user interaction then it should be reported as unknown.
Parameters:
  permission - to check if denied, allowed, or unknown.
 voiddestroyApp(boolean unconditional)
     Forwards destoryApp to the MIDlet.
public  MIDletgetMIDlet()
     Get the MIDlet for which this holds the state.
static  MIDletPeergetMIDletPeer(MIDlet m)
     Returns the MIDletPeer object corresponding to the given midlet instance.
final public  MIDletSuitegetMIDletSuite()
     Provides a MIDlet with a mechanism to retrieve MIDletSuite for this MIDlet.
 intgetState()
     Get the state.
public  voidhandleMIDletActivateEvent()
     Activate a MIDlet.
public  voidhandleMIDletDestroyEvent()
     Destroy a MIDlet.
public  voidhandleMIDletPauseEvent()
     Pause a MIDlet.
static  voidinitClass(MIDletStateHandler theMIDletStateHandler, MIDletStateListener theMIDletStateListener, PlatformRequest thePlatformRequestHandler)
     Initialize the MIDletPeer class.
final public  voidnotifyDestroyed()
     Used by a MIDlet to notify the application management software that it has entered into the DESTROYED state.
final public  voidnotifyPaused()
     Used by a MIDlet to notify the application management software that it has entered into the PAUSED state. Invoking this method will have no effect if the MIDlet is destroyed, or if it has not yet been started.
 voidpauseApp()
     Forwards pauseApp to the MIDlet.
final public  booleanplatformRequest(String URL)
     Requests that the device handle (e.g.
final public  voidresumeRequest()
     Used by a MIDlet to notify the application management software that it is interested in entering the ACTIVE state.
public static  voidsetMIDletTunnel(SecurityToken token, MIDletTunnel t)
     Sets up the reference to the MIDletTunnel implementation.
 voidsetState(int newState)
     Change the state and notify.
 voidsetStateWithoutNotify(int newState)
     Change the state without notifying the MIDletStateHandler.
 voidstartApp()
     Forwards startApp to the MIDlet.

Field Detail
ACTIVE
final public static int ACTIVE(Code)
State of the MIDlet is Active



ACTIVE_PENDING
final static int ACTIVE_PENDING(Code)
State of the MIDlet when resumed by the display manager



DESTROYED
final public static int DESTROYED(Code)
State of the MIDlet is Destroyed



DESTROY_PENDING
final static int DESTROY_PENDING(Code)
State of the MIDlet with destroy pending



PAUSED
final public static int PAUSED(Code)
State of the MIDlet is Paused; it should be quiescent



PAUSE_PENDING
final static int PAUSE_PENDING(Code)
State of the MIDlet when paused by the display manager



midlet
protected MIDlet midlet(Code)
The MIDlet for which this is the state.




Constructor Detail
MIDletPeer
MIDletPeer()(Code)
Creates a MIDlet's peer which is registered the MIDletStateHandler. Shall be called only from MIDletStateHandler.

The peer MIDlet field is set later when the MIDlet's constructor calls newMidletState.





Method Detail
checkPermission
public int checkPermission(String permission)(Code)
Get the status of the specified permission. If no API on the device defines the specific permission requested then it must be reported as denied. If the status of the permission is not known because it might require a user interaction then it should be reported as unknown.
Parameters:
  permission - to check if denied, allowed, or unknown. 0 if the permission is denied; 1 if the permission is allowed;-1 if the status is unknown



destroyApp
void destroyApp(boolean unconditional) throws MIDletStateChangeException(Code)
Forwards destoryApp to the MIDlet.
Parameters:
  unconditional - the flag to pass to destroy MIDletStateChangeException is thrownif the MIDletwishes to continue to execute (Not enter the Destroyedstate).This exception is ignored if unconditionalis equal to true.



getMIDlet
public MIDlet getMIDlet()(Code)
Get the MIDlet for which this holds the state. the MIDlet; will not be null.



getMIDletPeer
static MIDletPeer getMIDletPeer(MIDlet m)(Code)
Returns the MIDletPeer object corresponding to the given midlet instance.
Parameters:
  m - the midlet instance MIDletPeer instance associate with m



getMIDletSuite
final public MIDletSuite getMIDletSuite()(Code)
Provides a MIDlet with a mechanism to retrieve MIDletSuite for this MIDlet. MIDletSuite for this MIDlet



getState
int getState()(Code)
Get the state. current state of the MIDlet.



handleMIDletActivateEvent
public void handleMIDletActivateEvent()(Code)
Activate a MIDlet. MIDletEventConsumer I/F method.



handleMIDletDestroyEvent
public void handleMIDletDestroyEvent()(Code)
Destroy a MIDlet. MIDletEventConsumer I/F method.



handleMIDletPauseEvent
public void handleMIDletPauseEvent()(Code)
Pause a MIDlet. MIDletEventConsumer I/F method.



initClass
static void initClass(MIDletStateHandler theMIDletStateHandler, MIDletStateListener theMIDletStateListener, PlatformRequest thePlatformRequestHandler)(Code)
Initialize the MIDletPeer class. Should only be called by the MIDletPeerList (MIDletStateHandler).
Parameters:
  theMIDletStateHandler - the midlet state handler
Parameters:
  theMIDletStateListener - the midlet state listener
Parameters:
  thePlatformRequestHandler - the platform request handler



notifyDestroyed
final public void notifyDestroyed()(Code)
Used by a MIDlet to notify the application management software that it has entered into the DESTROYED state. The application management software will not call the MIDlet's destroyApp method, and all resources held by the MIDlet will be considered eligible for reclamation. The MIDlet must have performed the same operations (clean up, releasing of resources etc.) it would have if the MIDlet.destroyApp() had been called.



notifyPaused
final public void notifyPaused()(Code)
Used by a MIDlet to notify the application management software that it has entered into the PAUSED state. Invoking this method will have no effect if the MIDlet is destroyed, or if it has not yet been started.

It may be invoked by the MIDlet when it is in the ACTIVE state.

If a MIDlet calls notifyPaused(), in the future its startApp() method may be called make it active again, or its destroyApp() method may be called to request it to destroy itself.




pauseApp
void pauseApp()(Code)
Forwards pauseApp to the MIDlet.



platformRequest
final public boolean platformRequest(String URL) throws ConnectionNotFoundException(Code)
Requests that the device handle (e.g. display or install) the indicated URL.

If the platform has the appropriate capabilities and resources available, it SHOULD bring the appropriate application to the foreground and let the user interact with the content, while keeping the MIDlet suite running in the background. If the platform does not have appropriate capabilities or resources available, it MAY wait to handle the URL request until after the MIDlet suite exits. In this case, when the requesting MIDlet suite exits, the platform MUST then bring the appropriate application to the foreground to let the user interact with the content.

This is a non-blocking method. In addition, this method does NOT queue multiple requests. On platforms where the MIDlet suite must exit before the request is handled, the platform MUST handle only the last request made. On platforms where the MIDlet suite and the request can be handled concurrently, each request that the MIDlet suite makes MUST be passed to the platform software for handling in a timely fashion.

If the URL specified refers to a MIDlet suite (either an Application Descriptor or a JAR file), the request is interpreted as a request to install the named package. In this case, the platform's normal MIDlet suite installation process SHOULD be used, and the user MUST be allowed to control the process (including cancelling the download and/or installation). If the MIDlet suite being installed is an update of the currently running MIDlet suite, the platform MUST first stop the currently running MIDlet suite before performing the update. On some platforms, the currently running MIDlet suite MAY need to be stopped before any installations can occur.

If the URL specified is of the form tel:<number>, as specified in RFC2806, then the platform MUST interpret this as a request to initiate a voice call. The request MUST be passed to the "phone" application to handle if one is present in the platform.

Devices MAY choose to support additional URL schemes beyond the requirements listed above.

Many of the ways this method will be used could have a financial impact to the user (e.g. transferring data through a wireless network, or initiating a voice call). Therefore the platform MUST ask the user to explicitly acknowledge each request before the action is taken. Implementation freedoms are possible so that a pleasant user experience is retained. For example, some platforms may put up a dialog for each request asking the user for permission, while other platforms may launch the appropriate application and populate the URL or phone number fields, but not take the action until the user explicitly clicks the load or dial buttons.

true if the MIDlet suite MUST first exit before thecontent can be fetched.
Parameters:
  URL - The URL for the platform to load.
exception:
  ConnectionNotFoundException - ifthe platform cannot handle the URL requested.



resumeRequest
final public void resumeRequest()(Code)
Used by a MIDlet to notify the application management software that it is interested in entering the ACTIVE state. Calls to this method can be used by the application management software to determine which applications to move to the ACTIVE state.

When the application management software decides to activate this application it will call the startApp method.

The application is generally in the PAUSED state when this is called. Even in the paused state the application may handle asynchronous events such as timers or callbacks.




setMIDletTunnel
public static void setMIDletTunnel(SecurityToken token, MIDletTunnel t)(Code)
Sets up the reference to the MIDletTunnel implementation. This must be called exactly once during system initialization.
Parameters:
  token - security token for authorizing the caller
Parameters:
  t - the MIDletTunnel implementation



setState
void setState(int newState)(Code)
Change the state and notify. Check to make sure the new state makes sense. Changes to the status are protected by the midletStateHandler. Any change to the state notifies the midletStateHandler.
Parameters:
  newState - new state of the MIDlet



setStateWithoutNotify
void setStateWithoutNotify(int newState)(Code)
Change the state without notifying the MIDletStateHandler. Check to make sure the new state makes sense.

To be called only by the MIDletStateHandler or MIDletState while holding the lock on midletStateHandler.
Parameters:
  newState - new state of the MIDlet




startApp
void startApp() throws MIDletStateChangeException(Code)
Forwards startApp to the MIDlet. MIDletStateChangeException is thrown if theMIDlet cannot start now but might be ableto start at a later time.



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.