Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current Restore this Version View Page History

« Previous Version 3 Current »

Overview

Component properties are the primary mechanism for adding configuration to an application. By default, property values are defined in a composite file. In some cases, it may be necessary to externalize property values so that they can be changed without modifying a contribution archive. Fabric3 supports the ability to define property values in external XML files that are deployed separately from the contribution that references them.

Defining External Property Values

External property values are specified in a composite using an XPath expression that points to a value in an XML file:

<composite ... xmlns:f3-samples="urn:samples.fabric3.org">
    <component name="GatewayService">
        <implementation.java class="..."/>
        <property name="interval" source="$app//f3-samples:gateway/@timeout"/>
    </component>
</composite> 

The above example configures a property value to be sourced from the timeout attribute of the gateway element defined in the app XML file.  External configuration files must use the f3:config root element to define a name (in this case "app") and target namespace:

<config xmlns="urn:fabric3.org" name="app" targetNamespace="urn:samples.fabric3.org">
    <gateway tineout="100"/>
</config>

The app XML file is deployed separately from the contribution containing the Gateway component. Note that it is possible for multiple components to reference parts of the same external configuration file.