SHOW Signed

net.rim.device.api.system
Class CodeModuleManager

java.lang.Object
  |
  +--net.rim.device.api.system.CodeModuleManager

public final class CodeModuleManager
extends Object

Manages the Java code modules installed on the device.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Since:
JDE 3.6.0

Field Summary
 Category: Signed static int CMM_HASH_INVALID
          The operation failed due to an invalid hash.
 Category: Signed static int CMM_MODULE_INCOMPATIBLE
          The operation failed because the module is incompatible with an existing module.
 Category: Signed static int CMM_MODULE_INVALID
          The operation failed because the module is invalid.
 Category: Signed static int CMM_OK
          The operation completed successfully.
 Category: Signed static int CMM_OK_MODULE_OVERWRITTEN
          The operation completed successfully; a module was overwritten in the process.
 Category: Signed static int CMM_SIGNATURE_INVALID
          The operation failed due to an invalid signature.
 Category: Signed static int MODULE_FLAG_DELETE
          The module is scheduled for deletion.
 Category: Signed static int MODULE_FLAG_OTA
          The module is marked as having been loaded over-the-air.
 
Method Summary
 Category: Signed static int createNewModule(int length)
          Creates a new, empty module.
 Category: Signed static int createNewModule(int totalLength, byte[] data, int length)
          Creates a new, partially populated module.
 Category: Signed static boolean deleteModule(int moduleHandle, boolean force)
          Deletes a specific module.
 Category: Signed static ApplicationDescriptor[] getApplicationDescriptors(int moduleHandle)
          Returns the application descriptors contained in the specified module.
 Category: Signed static int getModuleCodeSize(int moduleHandle)
          Returns the size of a module's contained code.
 Category: Signed static String getModuleDescription(int moduleHandle)
          Retrieves the description for a module.
 Category: Signed static int getModuleFlags(int moduleHandle)
          Returns the flags for the specified module.
 Category: Signed static int getModuleHandle(String name)
          Returns the handle for the module with the specified name.
 Category: Signed static int getModuleHandleForObject(Object obj)
          Returns the handle of the module which defines an object's class.
 Category: Signed static int[] getModuleHandles()
          Returns handles for all existing modules.
 Category: Signed static byte[] getModuleHash(int moduleHandle)
          Returns the SHA hash of a module.
 Category: Signed static String getModuleName(int moduleHandle)
          Returns the name of a module.
 Category: Signed static String getModuleName(int moduleHandle, int index)
          Returns the name of a base module.
 Category: Signed static long getModuleTimestamp(int moduleHandle)
          Returns a module's creation time.
 Category: Signed static String getModuleURL(int moduleHandle)
          Returns the URL from which a module can be loaded.
 Category: Signed static String getModuleVendor(int moduleHandle)
          Returns the vendor information for a module.
 Category: Signed static String getModuleVersion(int moduleHandle)
          Returns the version of a module.
 Category: Signed static String getModuleVersion(int moduleHandle, int index)
          Retrieves the version of a base module.
 Category: Signed static boolean isLibrary(int moduleHandle)
          Determines if a module is a library.
 Category: Signed static int saveNewModule(int moduleHandle)
          Saves a newly created module in the database.
 Category: Signed static boolean writeNewModule(int moduleHandle, byte[] data, int offset, int length)
          Writes data into a newly created module.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMM_OK

public static final int CMM_OK
The operation completed successfully.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

CMM_OK_MODULE_OVERWRITTEN

public static final int CMM_OK_MODULE_OVERWRITTEN
The operation completed successfully; a module was overwritten in the process.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

CMM_HASH_INVALID

public static final int CMM_HASH_INVALID
The operation failed due to an invalid hash.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

CMM_SIGNATURE_INVALID

public static final int CMM_SIGNATURE_INVALID
The operation failed due to an invalid signature.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

CMM_MODULE_INVALID

public static final int CMM_MODULE_INVALID
The operation failed because the module is invalid.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

CMM_MODULE_INCOMPATIBLE

public static final int CMM_MODULE_INCOMPATIBLE
The operation failed because the module is incompatible with an existing module.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

MODULE_FLAG_DELETE

public static final int MODULE_FLAG_DELETE
The module is scheduled for deletion.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

MODULE_FLAG_OTA

public static final int MODULE_FLAG_OTA
The module is marked as having been loaded over-the-air.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

getModuleHandles

public static int[] getModuleHandles()
Returns handles for all existing modules.

Returns:
An array of integers containing the handles of all modules in the database.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleHandleForObject

public static int getModuleHandleForObject(Object obj)
Returns the handle of the module which defines an object's class.

Parameters:
obj - Object for which you want to find the containing module.
Returns:
Handle of the module which defines your object's class. If your object is an array, this method treats it as an Object.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleHandle

public static int getModuleHandle(String name)
Returns the handle for the module with the specified name.

Parameters:
name - Name of the module.
Returns:
Module handle, or 0 if no module with the specified name exists.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

deleteModule

public static boolean deleteModule(int moduleHandle,
                                   boolean force)
Deletes a specific module.

If the module is currently in use, it will be deleted at the next reset.

If 'force' is false and the device contains data associated with the specified module, the module will not be deleted. If 'force' is true, then the module and any data associated with that module will be deleted.

Parameters:
moduleHandle - Handle of module to delete.
force - If true, delete the module and any data it owns; if false, delete the module only if it has no associated data.
Returns:
True if the module was deleted immediately or was scheduled for deletion; otherwise, false.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleFlags

public static int getModuleFlags(int moduleHandle)
Returns the flags for the specified module.
Parameters:
moduleHandle - Handle to the module in question.
Returns:
A combination of the MODULE_FLAG_ values.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleName

public static String getModuleName(int moduleHandle)
Returns the name of a module.

Parameters:
moduleHandle - Handle to the module in question.
Returns:
Name of module.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleVersion

public static String getModuleVersion(int moduleHandle)
Returns the version of a module.

Parameters:
moduleHandle - Handle to the module in question.
Returns:
Version information string, or null if the module has no version string.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleHash

public static byte[] getModuleHash(int moduleHandle)
Returns the SHA hash of a module.

Parameters:
moduleHandle - Handle to the module in question.
Returns:
SHA hash of the module.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleVendor

public static String getModuleVendor(int moduleHandle)
Returns the vendor information for a module.

Parameters:
moduleHandle - Handle to the module in question.
Returns:
Vendor information string, or null if the module has no vendor string.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleDescription

public static String getModuleDescription(int moduleHandle)
Retrieves the description for a module.

Parameters:
moduleHandle - Handle to the module in question.
Returns:
Description string, or null if the module has no description string.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleURL

public static String getModuleURL(int moduleHandle)
Returns the URL from which a module can be loaded.

Parameters:
moduleHandle - Handle to the module in question.
Returns:
URL string, or null if the module has no URL string.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleTimestamp

public static long getModuleTimestamp(int moduleHandle)
Returns a module's creation time.

Parameters:
moduleHandle - Handle to the module in question.
Returns:
Time in milliseconds since the device's origin time (midnight, Jan 1, 1970 UTC).
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isLibrary

public static boolean isLibrary(int moduleHandle)
Determines if a module is a library.

Parameters:
moduleHandle - Handle to the module in question.
Returns:
True if the specified module is a library; otherwise, false.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleCodeSize

public static int getModuleCodeSize(int moduleHandle)
Returns the size of a module's contained code.

Parameters:
moduleHandle - Handle to the module in question.
Returns:
Module's code size in bytes.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleName

public static String getModuleName(int moduleHandle,
                                   int index)
Returns the name of a base module.

Parameters:
moduleHandle - Handle to the module in question.
index - Ordinal to the module name in question.
Returns:
Name of module, or null if the index is out of range.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getModuleVersion

public static String getModuleVersion(int moduleHandle,
                                      int index)
Retrieves the version of a base module.

Parameters:
moduleHandle - Handle to the module in question.
index - Ordinal to the module name in question.
Returns:
Version information string, or null if the module has no version string or the index is out of range.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

createNewModule

public static int createNewModule(int length)
Creates a new, empty module.

Parameters:
length - Length in bytes to set aside for module.
Returns:
Module handle, or 0 if the module could not be created.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

createNewModule

public static int createNewModule(int totalLength,
                                  byte[] data,
                                  int length)
Creates a new, partially populated module.

If the number of bytes you have to provide (the length parameter) is less than the length of the module (the totalLength parameter), then you should write the rest of the data with subsequent invocations of writeNewModule.

Parameters:
totalLength - Length in bytes of the entire module.
data - Byte array of data to stuff into module.
length - Number of bytes from the byte array to stuff into the start of the module.
Returns:
Module handle, or 0 if the module could not be created.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

writeNewModule

public static boolean writeNewModule(int moduleHandle,
                                     byte[] data,
                                     int offset,
                                     int length)
Writes data into a newly created module.

Parameters:
moduleHandle - Handle to the module in question.
data - Byte array of data to stuff into module.
offset - Byte offset into the module at which to being stuffing.
length - Number of bytes from the byte array to stuff into the module.
Returns:
True if successful; false otherwise.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

saveNewModule

public static int saveNewModule(int moduleHandle)
Saves a newly created module in the database.

Parameters:
moduleHandle - Handle to module in question.
Returns:
One of the CMM_ return codes.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getApplicationDescriptors

public static ApplicationDescriptor[] getApplicationDescriptors(int moduleHandle)
Returns the application descriptors contained in the specified module.

Parameters:
moduleHandle - A handle to the specified module.
Returns:
The ApplicationDescriptor array.
Since:
JDE 3.7.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.