net.rim.device.api.system
Class CodeModuleGroupManager

java.lang.Object
  extended by net.rim.device.api.system.CodeModuleGroupManager

public class CodeModuleGroupManager
extends Object

Code module group management functionality

Code module groups provide a way for the device to store meta-information associated with groups of modules (for example, all the modules that make up a single application). The device stores code module group data in serialized form in a persisted store in the file system. Access to this store is moderated by the code module group manager system singleton.

Users of the code module group manager can identify modules in two ways: by name (string value), and by handle (integer value).

Writing code module group data into the store. To save a code module group's raw data into the store, use CodeModuleGroupManager.createGroup(byte[]). Note that the manager does no parsing of the group data block: it merely writes the block directly into the group data store.

Typically, though, you will want to instantiate a CodeModuleGroup first, set it's properties as appropriate, and then invoke CodeModuleGroup.store() to serialize and store it (the method calls back to this manager to do the storage, and writes the module group handle into the group instance).

Getting code module group data out of the store. You can retrieve the code module group's data of the store in two general ways. To retrieve the raw data block, use getGroupData(moduleGroupHandle).

To retrieve the group data as a re-constituted, new CodeModuleGroup instance, you have a number of options.

You can retrieve the code module group by name with load(moduleGroupName).

You can retrieve an array of all known code module groups with CodeModuleGroupManager.loadAll().

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.1

Method Summary
Category: Signed static int getNumberOfGroups()
          Retrieves the current number of code module groups.
Category: Signed static CodeModuleGroup load(String groupName)
          Loads code module group by name.
Category: Signed static CodeModuleGroup[] loadAll()
          Retrieves all known code module group data blocks into an array of CodeModuleGroup instances.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

load

public static CodeModuleGroup load(String groupName)
Loads code module group by name.

Invoke this method to load the data for a named code module group into a CodeModuleGroup instance and then retrieve the object.

Parameters:
groupName - Name of group to load; must not be null or longer than 256 characters.
Returns:
Named group or null, if no such group exists or is loadable.
Throws:
IllegalArgumentException - If you provide a group name that's too long.
NullPointerException - If you provide a null group name.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.1

loadAll

public static CodeModuleGroup[] loadAll()
Retrieves all known code module group data blocks into an array of CodeModuleGroup instances.

Returns:
All known code module groups; may be null if no code module groups known at the moment.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.1

getNumberOfGroups

public static int getNumberOfGroups()
Retrieves the current number of code module groups.

Returns:
Number of code module groups the device has in its store of group data blocks.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.1





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal