Component Directive
Description
A component directive is an instruction to a container to mount and deploy a component instance in accordance with the declared configuration, context, parameters and activation policy.
Attributes
Attribute | Required | Description |
---|---|---|
name | yes | The name to assign to the component profile implied by the directive. |
class | yes | The classname of the component implementation. |
activation | no | The activation policy. Recognized values include 'startup' and 'lazy'. |
profile | no | The name of a template profile. If supplied, the name must correspond to a named profile assoiated with the component type. The resulting component will be based on the the template. Addition directives contained with the component element are ignored at this time. Future version may provide support for profile extension. Since 3.1 |
Nested Elements
Element | Cardinality | Description |
---|---|---|
categories | 0..1 | Defintion of the priority and targets parameterization to apply to logging channels declared by the component. |
context | 0..1 | Defintion of the context class and entries. |
dependencies | 0..1 | Optional declaration of explicit dependency provider assignments. |
parameters | 0..1 | Defintion of the parameters to be supplied during Parameterization of the component. |
configuration | 0..1 | The configuration fragment to be applied to the target component during a configuration lifecycle stage. |
Sample XML
<container name="tutorial"> <component name="hello" class="tutorial.HelloComponent" activation="startup"> <!-- optional categories element --> <!-- optional configuration or parameters element --> <!-- optional context element --> </component> </block>