FileDocCategorySizeDatePackage
CHManager.javaAPI DocphoneME MR2 API (J2ME)5312Wed May 02 18:00:08 BST 2007com.sun.midp.content

CHManager

public class CHManager extends Object
Stub interface to handle ContentHandlers functions. This version has no dependentcie to the CLDC AMS classes. It is needed by com.sun.midp.installer.Installer and com.sun.midp.midletsuite.MIDletStorage. When these classes not longer reference this class, it can be removed.

Fields Summary
Constructors Summary
private CHManager()
Creates a new instance of CHInstaller.

    
Methods Summary
public java.lang.StringgetInstallURL(javax.microedition.midlet.MIDlet midlet)
Check for a URL to install from the Invocation mechanism, if one has been queued.

param
midlet the MIDlet that is the content handler.
return
the URL to install; null if none is available
see
com.sun.midp.content.CHInstallerImpl

	return null;
    
public static com.sun.midp.content.CHManagergetManager(com.sun.midp.security.SecurityToken token)
Get the Content Handler manager if the system is configured to implement content handlers. A dummy handler is returned if content handlers are not supported.

param
token the SecurityToken to get the CHManager
return
the CHInstaller instance to be used to handle management and installation of content handlers.
see
com.sun.midp.content.CHInstaller
exception
SecurityException if the token or suite is not allowed

        return new CHManager();
    
public voidinstall()
Install the content handlers found and verified by preInstall. Register any content handlers parsed from the JAD/Manifest attributes.

exception
InvalidJadException thrown if the application descriptor is invalid

    
public voidinstallDone(boolean success)
Notify the invocation mechanism that the install of the URL provided by {@link #getURLToInstall} succeeded or failed.

param
success true if the install was a success; false otherwise
see
com.sun.midp.content.CHInstallerImpl

    
public voidmidletInit(int suiteId, java.lang.String classname)
Notification that a MIDlet is about to be created. Stub implementation used when CHAPI is not present.

param
suiteId the storage name of the MIDlet suite
param
classname the midlet classname
see
com.sun.midp.midlet.MIDletState

    
public voidpreInstall(com.sun.midp.installer.Installer installer, com.sun.midp.installer.InstallState state, com.sun.midp.midlet.MIDletSuite msuite, java.lang.String authority)
Parse the ContentHandler attributes and check for errors.
  • Parse attributes into set of ContentHandlers.
  • If none, return
  • Check for permission to install handlers
  • Check each for simple invalid arguments
  • Check each for MIDlet is registered
  • Check each for conflicts with other application registrations
  • Find any current registrations
  • Merge current dynamic current registrations into set of new
  • Check and resolve any conflicts between static and curr dynamic
  • Retain current set and new set for registration step.

param
installer the installer with access to the JAR, etc.
param
state the InstallState with the attributes and other context
param
msuite access to information about the suite
param
authority the authority, if any, that authorized the trust level
exception
InvalidJadException if there is no classname field, the option field is not "true", "false" or blank or if there are more than five comma separated fields on the line.

    
public voiduninstall(int suiteId)
Uninstall the Content handler specific information for the specified suiteId.

param
suiteId the suite ID