As the name suggests, the construct.properties file defines settings for the Construct platform. The settings cover three things: global properties for Construct, the components to be instantiated at runtime, and the individual properties of each component.
In the current release, all (bar one) of the global properties are related to logging. The other refers to the hostname of the machine running the Construct software:
| Logging level | The level of log messages to be recorded |
|---|---|
| The Logging limit | The maximum number of bytes to write to any one log file |
| The logging file count | The number of log files to rotate |
| The logging file name | The base name to use for log files |
| The logging directory | The directory in which the log files are stored |
| The hostname | The hostname or IP address of the machine running the Construct software |
The components that you wish to instantiate once the Construct framework is started are also contained in the properties file. Some components also contain properties which are specific to those components and must be declared as children of the components in the properties file. The structure of the properties file is explained further on. Below is an example of some Construct components. More thorough explanations can be found elsewhere on the Wiki.
| Data Store Manager | Provides a single point of access to the data store |
|---|---|
| Query Service | Processes application and entity queries made in SPARQL |
| Data Port | Accepts RDF data provided by sensors and adds them to the data store |
| Registry Service | Stores information on registered services |
| Discovery Service | Handles requests from clients for available Construct services |
| Gossiping Components | Allows distribution of data store contents |
| Extension Components | Add-on components such as a Query Viewer |
Once the start button is clicked on the Construct GUI, a Component Loader is created which reads in the contents of the properties file and instantiates any components that are specified. On instantiation, each component fetches it’s properties and caters for them.
Reading and Writing to the construct.properties File
The construct.properties file is and XML encoded file in which all properties and components must be contained within the parent node, construct (i.e. it takes the form … ). Global properties must be contained directly inside the construct tags and they are indicated by a property tag. Thus, all properties take the form,
-
<property name=“[the name here]“ value=“[the value here]“ />
Components must also be defined directly inside the construct tags. The component specific properties must be declared directly inside the opening and closing tags of the component in question. Components are scripted as follows:
-
<component interface=“[the interface to the component here]“ implementation=“[the implementation of the component here]“>
-
<property … />
-
</component>
where the interface specifies the path to the interface for the component and the implementation specifies the path to the concrete implementation of the component.
There is an example properties file contained in the release of Construct. To add new properties follow the structure of the document as explained above. HTML style comments (i.e. <!– [the code to comment here] –>) can be used to prevent a property or component contained in the file from being read in. Ensure to comment the property or component by adding the opening comment (<!–) before the opening tag of the component or property and adding the closing comment (–>) after the closing tag.
![[del.icio.us]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/digg.png)
![[Google]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/google.png)
![[StumbleUpon]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Windows Live]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/email.png)