DmtAdmin
should register itself in the OSGi service registry as a service. DmtAdmin
is the entry point for applications to use the DMT API. The getSession
methods are used to open a session on a specified subtree of the DMT. A typical way of usage:
serviceRef = context.getServiceReference(DmtAdmin.class.getName()); DmtAdmin admin = (DmtAdmin) context.getService(serviceRef); DmtSession session = admin.getSession("./OSGi/Configuration"); session.createInteriorNode("./OSGi/Configuration/my.table");
The methods for opening a session take a node URI (the session root) as a parameter. All segments of the given URI must be within the segment length limit of the implementation, and the special characters '/' and '\' must be escaped (preceded by a '\'). Any string can be converted to a valid URI segment using the {@link Uri#mangle(String)} method.
It is possible to specify a lock mode when opening the session (see lock type constants in {@link DmtSession}). This determines whether the session can run in parallel with other sessions, and the kinds of operations that can be performed in the session. All Management Objects constituting the device management tree must support read operations on their nodes, while support for write operations depends on the Management Object. Management Objects supporting write access may support transactional write, non-transactional write or both. Users of DmtAdmin
should consult the Management Object specification and implementation for the supported update modes. If Management Object definition permits, implementations are encouraged to support both update modes.
This interface also contains methods for manipulating the set of DmtEventListener
objects that are called when the structure or content of the tree is changed. These methods are not needed in an OSGi environment, clients should register listeners through the Event Admin service.
|
|
|
|
|
|
|
|