assembly.core.board:rfid.antenna:static
KOS leverages web-based concepts and technologies to accelerate development. This includes providing extensive support for creating endpoints and using those endpoints across applications and user interfaces. One challenge with endpoints is the need to identify a particular java object that the endpoint should operate on. In typical web-based applications, identity is in the form of an id that corresponds to an entry in a database table. Device software differs from typical web software in that control objects are long living objects that are wired together and not just data beans that can be loaded from a database. This introduces challenges in id assignment. In general, KOS requires an id system with the following criteria:
Deterministic : A given object must have a deterministic identity that is not impacted by the addition or removal of other objects. This identity must remain the same over the entire life of the device.
Universal : An object identity within a device must be unique, and the same object in two different devices must have the same id.
Readable : While id’s should be opaque to software, they should be human readable so they have meaning in log files. KOS provides such a system based on handles and handle paths.
KOS provides a Handle object and HandleAware interface. Any object that needs to be identified implements HandleAware and has a Handle property. As these objects are added to other HandleAware objects, the handles are chained together back to a root. This results in each object having an identity, which is constructed from the path from the root to the object. Many core pieces of KOS are HandleAware, and automatically chain objects together so in many cases the construction of handle paths is not visible to the developer. As handle paths are constructed from the path to an object, the resulting identity is human readable, such as :
assembly.core.board:rfid.antenna:static
Every HandleAware object is tracked within KOS. The HandleService can be used to return any object from its handle. This service tracks objects with weak references so the objects are free to be garbage collected when no longer in use. Accessing objects from handles via endpoints is so common that KOS provides a standard endpoint annotation for this use case. Simply define the url parameter that contains a handle path and declare the class of the expected object, and the web server will return the object directly to the endpoint callback. Handles also play a critical role in the KOS configuration system. Every configurable object in KOS is HandleAware, allowing the configuration system to find the live object, update it and persist changes using the handle path as the key for the object.