provides support for all the mandatory DM 1.1.2 client wire commands, together with an API for manipulating the device tree locally. Custom nodes are created by subclassing and implementing the abstract methods in AbstractInterior
, then adding instances of the class into the device tree.
As previously noted, the device tree represents all manageable settings on the device, including in volatile or non-volatile memory and file or I/O system. Custom nodes enable resources that are external to the framework to be manipulated. For example, you can implement a custom node to set the time and declare it into the device tree as ./device/time
. Subsequent commands to get and replace the value of that node could then trigger JNI code to get and set the actual OS system time.
You can save memory, by virtualizing sub-trees using custom nodes, rather than by providing a one-to-one mapping between persistent device tree nodes and resources. A reference to a URI that is a logical child to the custom node dynamically instantiates an appropriate node, enabling it to be manipulated by the wire commands. For example, to make the files of a computer disk drive manageable using the device tree, rather than populate the tree with hundreds of interior nodes and thousands of leaf nodes, you can implement and add a single custom node to the device tree as ./device/driveC
, referencing the drive root. In this example, as wire commands to manipulate files on the drive are received, the custom node dynamically creates nodes to model the addressed file, to which the wire commands are forwarded.
Parent topic: Understanding SyncML development: XPD622