Declaration of the initial context model state together including context entry key/value bindings. A context directive typically contains a series of <entry> directives where each directive asserts a default inital value for a context entry key. Any required context entry declared by a component must be associated with a context entry directive. Failure to provide context entry directives for all required context keys will result ina build failure.
entry | The entry element may contain 0..n nested <entry> directives. A entry directive allows the creation by (value or reference) of a value associated with a context entry key. |
The following example demonstrates a variety of context entry directives including the usage of symbolic values, static field references, direct value creation, composite value creation, and service wiring.
<context> <entry key="name" value="$${user.name}"/> <entry key="printer" lookup="org.acme.Printer"/> <entry key="background" method="RED"/> <entry key="foreground"> <value class="float" value="100"/> <value class="float" value="200"/> <value class="float" value="0"/> </entry> <entry key="widget" class="org.acme.DefaultWidget"> <value class="org.acme.DefaultGizmo"> <value class="float" value="0"/> <value class="int" value="1024"/> </value> </entry> </context>
The context descriptor class provides support for the declaration of an alternative context class hewever this feature is not currently supporting within the runtime.