de.smartics.properties.tutorial.boot
Class BootPropertiesTutorial

Package class diagram package BootPropertiesTutorial
java.lang.Object
  extended by de.smartics.properties.tutorial.boot.BootPropertiesTutorial

@Document(title="Using Boot Properties",
          sortKey="basics1001")
@DocCategory(value="basics")
public class BootPropertiesTutorial
     
     
extends Object

This tutorial shows how to use BootProperties.


Constructor Summary
BootPropertiesTutorial()
           
 
Method Summary
 void bootProperties()
           BootProperties provide a simple interface to control the process of dealing with properties.
 void setUp()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BootPropertiesTutorial

public BootPropertiesTutorial()
Method Detail

setUp

public void setUp()

bootProperties

@DocChapter
public void bootProperties()
                    throws MalformedURLException

BootProperties provide a simple interface to control the process of dealing with properties. Boot properties are read in advance before any other properties are evaluated.

Boot properties are provided by the system as is. User's cannot add custom properties to it. Boot properties are used to control the process through configuration and cannot be accessed by user code.

In contrast to other properties files boot.properties have to be placed under the META-INF/smartics-properties folder.

Currently there is only one boot property called additionalPropertiesLocations that allows to add additional locations for properties definitions. One use case for this property is to add a path to a (maybe removable) device where sensible properties are stored. Or it is simply a path to a location where operations has convenient access to.

The property is specified as shown in the following example.

 smartics.properties.additionalPropertiesLocations=file:/D:/Transfer/external
 

The values are expected to be valid URLs. The usual constraints on specifying multiple properties apply (please refer to ListPropertyTutorial for details).

Although the boot properties can be accessed, the client code does not see the actual properties, as you can see at in the following example:

Throws:
MalformedURLException


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.