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


java.lang.Object
   com.sun.midp.content.AppProxy

All known Subclasses:   com.sun.midp.content.AppBundleProxy,
AppProxy
class AppProxy (Code)
Each AppProxy instance provides access to the AMS information and functions for a running or installed application. This class must be replaced for each platform/profile combination and be integrated with the appropriate Applicaiton Management Software.

The AppProxy class is *only* available within this package for security purposes. An instance exists for the current application and can be retrieved for any installed application. The following methods provide functions needed by CHAPI:

  • AppProxy.getCurrent - the current application and the main class within it.
  • AppProxy.forApp - the AppProxy for a named Jar ID and classname. For MIDP, they are the suiteID of the storage and MIDlet within the JAR.
  • AppProxy.getStorageID - the storage ID for this AppProxy.
  • AppProxy.getClassname - the classname for this AppProxy.
  • AppProxy.getApplicationID - the CHAPI defined unique identifier for the application
  • AppProxy.getApplicationName = a user friendly name for this application.
  • AppProxy.getAuthority - the authority under which the application is granted permissions. For MIDP, the subject field of the signing certificate.
  • AppProxy.getProperty - access to the properties in the manifest or application descriptor.
  • AppProxy.getVersion - the version number of this application.
  • AppProxy.getDefaultID - the default applicationID if none is provided in the manifest or application descriptor.
  • AppProxy.checkRegisterPermission - method to check if the caller is allowed to register or unregister handlers.
  • AppProxy.checkAPIPermission - method to check if the caller has permission to use internal APIs. Caller must have an appropriate security token (depending on the platform)
  • AppProxy.isRegistered - used to check if the application is registered as appropriate for the platform. For MIDP, there is a MIDlet-n attribute in manifest or JAD.
  • AppProxy.verifyApplication - Verify that a named class is the correct type and access to be launched as an application in the profile. For MIDP, the class must extend MIDlet.
  • AppProxy.launch - Request this application be launched if it is not already running. Return a boolean indicating if the current application MUST voluntarily exit before the launched app can run.
  • AppProxy.requestForeground - ask the "window manager" to give the foreground to the requested application. <


Field Summary
final static  booleanLOG_INFO
     The log flag to enable informational messages.
final static  StringVENDOR_PROP
     MIDlet property for the suite vendor.
final static  StringVERSION_PROP
     MIDlet property for the suite version.
protected  Hashtableappmap
     The known AppProxy instances.
protected  Stringclassname
     The classname of the application.
final protected  MIDletSuitemsuite
     The MIDlet suite for this app.
final protected static  Objectmutex
     The mutex used to avoid corruption between threads.
final protected  intstorageId
     The storageId (suiteId) for this application.

Constructor Summary
protected  AppProxy(MIDletSuite msuite, String classname, Hashtable appmap)
     Construct an AppProxy with the specified MIDletSuite.
protected  AppProxy(int storageId, String classname)
     Construct an AppProxy with the specified suiteId, classname.

Method Summary
final static  voidcheckAPIPermission(Object securityToken)
     Check if the internal API use is allowed.
final  voidcheckRegisterPermission(String reason)
     Check the permission to register or unregister.
 AppProxyforApp(int storageId, String classname)
     Gets the AppProxy for an storageID and classname.
 AppProxyforClass(String classname)
     Gets the AppProxy for an application class in the current bundle.
 StringgetApplicationID()
     Gets the CHAPI application ID for this application.
 StringgetApplicationName()
     Gets the user friendly application name.
 StringgetAuthority()
     Gets the Trusted authority that authenticated this application.
 StringgetClassname()
     Gets the classname of this application.
static  AppProxygetCurrent()
     Gets the AppProxy for the currently running application.
 StringgetDefaultID()
     Gets the content handler ID for the current application.
 StringgetProperty(String key)
     Gets a property from the manifest or application descriptor.
 intgetStorageId()
     Gets the storage ID of this application.
 StringgetVersion()
     Gets the version string for the application.
protected  voidinitAppInfo()
     Initialize application name and application ID from the attributes.
 booleanisRegistered()
     Gets true if the application is a registered application.
 booleanlaunch(String displayName)
     Launch this application. Don't launch another application unless the execute allows this application to continue after the launch.

In SVM, (sequential applications) only the first execute matters; later ones should not override the first.

 voidlogException(String msg, Throwable t)
     Log an information message to the system logger for this AppProxy.
 voidlogInfo(String msg)
     Log an information message to the system logger for this AppProxy.
static  voidrequestForeground(int invokingSuiteId, String invokingClassname, int targetSuiteId, String targetClassname)
     Request the transition of the foreground to this application from the invoking application.
static  voidrequestForeground(int targetSuiteId, String targetClassname)
     The stronger variant for request the transition of the foreground to this application.
static  voidsetSecurityToken(SecurityToken token)
     Sets the security token used for priveleged operations.
public  StringtoString()
     Create a printable representation of this AppProxy.
protected  voidverifyApplication(String classname)
     Verify that the classname is a valid application.

Field Detail
LOG_INFO
final static boolean LOG_INFO(Code)
The log flag to enable informational messages.



VENDOR_PROP
final static String VENDOR_PROP(Code)
MIDlet property for the suite vendor.



VERSION_PROP
final static String VERSION_PROP(Code)
MIDlet property for the suite version.



appmap
protected Hashtable appmap(Code)
The known AppProxy instances. Key is classname.



classname
protected String classname(Code)
The classname of the application.



msuite
final protected MIDletSuite msuite(Code)
The MIDlet suite for this app.



mutex
final protected static Object mutex(Code)
The mutex used to avoid corruption between threads.



storageId
final protected int storageId(Code)
The storageId (suiteId) for this application.




Constructor Detail
AppProxy
protected AppProxy(MIDletSuite msuite, String classname, Hashtable appmap) throws ClassNotFoundException(Code)
Construct an AppProxy with the specified MIDletSuite.
Parameters:
  msuite - the MIDletSuite to initialize.
Parameters:
  classname - the classname of a copackaged application.
Parameters:
  appmap - a Hashtable to keep track of instances; may be null
exception:
  ClassNotFoundException - if the classnameis not present
exception:
  IllegalArgumentException - if classname is nota valid application



AppProxy
protected AppProxy(int storageId, String classname)(Code)
Construct an AppProxy with the specified suiteId, classname. This is just a placeholder to make launch work.
Parameters:
  storageId - the suiteId
Parameters:
  classname - the classname




Method Detail
checkAPIPermission
final static void checkAPIPermission(Object securityToken)(Code)
Check if the internal API use is allowed.
Parameters:
  securityToken - a generic security token
exception:
  SecurityException - thrown if internal API use not allowed



checkRegisterPermission
final void checkRegisterPermission(String reason)(Code)
Check the permission to register or unregister.
Parameters:
  reason - the reason for the permission check
exception:
  SecurityException - if not allowed



forApp
AppProxy forApp(int storageId, String classname) throws ClassNotFoundException(Code)
Gets the AppProxy for an storageID and classname.
Parameters:
  storageId - the storageId (suiteId)
Parameters:
  classname - the name of the application class the AppProxy for suiteId, classname;null if not a valid application (MIDlet)
exception:
  ClassNotFoundException - if the classnameis not present
exception:
  IllegalArgumentException - if classname is nota valid application



forClass
AppProxy forClass(String classname) throws ClassNotFoundException(Code)
Gets the AppProxy for an application class in the current bundle.
Parameters:
  classname - the name of the application class the AppProxy for classname; null if nota valid application (MIDlet)
exception:
  ClassNotFoundException - if the classnameis not present
exception:
  IllegalArgumentException - if classname isnot a valid application



getApplicationID
String getApplicationID()(Code)
Gets the CHAPI application ID for this application. the CHAPI application ID.



getApplicationName
String getApplicationName()(Code)
Gets the user friendly application name. the user friendly application name



getAuthority
String getAuthority()(Code)
Gets the Trusted authority that authenticated this application.

For MIDP, this is the CA of the signer. If exception is thrown during getting authorization this methods ignores it and returns null. the authority.




getClassname
String getClassname()(Code)
Gets the classname of this application. the classname



getCurrent
static AppProxy getCurrent()(Code)
Gets the AppProxy for the currently running application. the current application.



getDefaultID
String getDefaultID()(Code)
Gets the content handler ID for the current application. The ID uniquely identifies the application which contains the content handler. The application ID is assigned when the application is installed.

All installed applications have vendor and name; the ID; MUST NOT be null




getProperty
String getProperty(String key)(Code)
Gets a property from the manifest or application descriptor.
Parameters:
  key - the name of the property to retrieve the value of the property or null



getStorageId
int getStorageId()(Code)
Gets the storage ID of this application. The ID uniquely identifies the package/application bundle. the application ID.



getVersion
String getVersion()(Code)
Gets the version string for the application. the version



initAppInfo
protected void initAppInfo()(Code)
Initialize application name and application ID from the attributes.



isRegistered
boolean isRegistered()(Code)
Gets true if the application is a registered application.

for MIDP, this means there was a MIDlet-n attribute. true if this application is registered




launch
boolean launch(String displayName)(Code)
Launch this application. Don't launch another application unless the execute allows this application to continue after the launch.

In SVM, (sequential applications) only the first execute matters; later ones should not override the first. All pending Invocations are queued in InvocationStore so they will not be lost. When MIDlets exit, another application will be selected from those pending.
Parameters:
  displayName - name to show to the user of what to launch true if the application must existbefore the target application can proceed.




logException
void logException(String msg, Throwable t)(Code)
Log an information message to the system logger for this AppProxy.
Parameters:
  msg - a message to write to the log.
Parameters:
  t - Throwable to be logged



logInfo
void logInfo(String msg)(Code)
Log an information message to the system logger for this AppProxy.
Parameters:
  msg - a message to write to the log.



requestForeground
static void requestForeground(int invokingSuiteId, String invokingClassname, int targetSuiteId, String targetClassname)(Code)
Request the transition of the foreground to this application from the invoking application.
Parameters:
  invokingSuiteId - the invoking suiteId
Parameters:
  invokingClassname - the invoking classname
Parameters:
  targetSuiteId - the target suiteId
Parameters:
  targetClassname - the target classname



requestForeground
static void requestForeground(int targetSuiteId, String targetClassname)(Code)
The stronger variant for request the transition of the foreground to this application.
Parameters:
  targetSuiteId - the target suiteId
Parameters:
  targetClassname - the target classname



setSecurityToken
static void setSecurityToken(SecurityToken token)(Code)
Sets the security token used for priveleged operations. The token may only be set once.
Parameters:
  token - a Security token



toString
public String toString()(Code)
Create a printable representation of this AppProxy. a printable string



verifyApplication
protected void verifyApplication(String classname) throws ClassNotFoundException(Code)
Verify that the classname is a valid application. It must extend MIDlet.
Parameters:
  classname - the application class
exception:
  ClassNotFoundException - is thrown if the class cannot be found
exception:
  IllegalArgumentException - if the classname is null or emptyor does not implement the lifecycle of a MIDlet.



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.