| |
|
| 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 boolean | LOG_INFO The log flag to enable informational messages. | final static String | VENDOR_PROP MIDlet property for the suite vendor. | final static String | VERSION_PROP MIDlet property for the suite version. | protected Hashtable | appmap The known AppProxy instances. | protected String | classname The classname of the application. | final protected MIDletSuite | msuite The MIDlet suite for this app. | final protected static Object | mutex The mutex used to avoid corruption between threads. | final protected int | storageId 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 void | checkAPIPermission(Object securityToken) Check if the internal API use is allowed. | final void | checkRegisterPermission(String reason) Check the permission to register or unregister. | AppProxy | forApp(int storageId, String classname) Gets the AppProxy for an storageID and classname. | AppProxy | forClass(String classname) Gets the AppProxy for an application class in the current bundle. | String | getApplicationID() Gets the CHAPI application ID for this application. | String | getApplicationName() Gets the user friendly application name. | String | getAuthority() Gets the Trusted authority that authenticated this application. | String | getClassname() Gets the classname of this application. | static AppProxy | getCurrent() Gets the AppProxy for the currently running application. | String | getDefaultID() Gets the content handler ID for the current application. | String | getProperty(String key) Gets a property from the manifest or application descriptor. | int | getStorageId() Gets the storage ID of this application. | String | getVersion() Gets the version string for the application. | protected void | initAppInfo() Initialize application name and application ID
from the attributes. | boolean | isRegistered() Gets true if the application is a registered application. | boolean | launch(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. | void | logException(String msg, Throwable t) Log an information message to the system logger for this AppProxy. | void | logInfo(String msg) Log an information message to the system logger for this AppProxy. | static void | requestForeground(int invokingSuiteId, String invokingClassname, int targetSuiteId, String targetClassname) Request the transition of the foreground to this application
from the invoking application. | static void | requestForeground(int targetSuiteId, String targetClassname) The stronger variant for request the transition of
the foreground to this application. | static void | setSecurityToken(SecurityToken token) Sets the security token used for priveleged operations. | public String | toString() Create a printable representation of this AppProxy. | protected void | verifyApplication(String classname) Verify that the classname is a valid application. |
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.
|
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.
|
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 classname is 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 |
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 classname is not present exception: IllegalArgumentException - if classname is nota 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. |
|
|
|