DPML
DPML Metro Component Task
HomeUtilitiesStationMetro
Component Task
Description

The component task automates the creation of component deployment meta data.

Attributes
type Set the component type classname (required).
key Required only when declaring a nested component within a type. The key corresponds to the internal key that uniquely identifies the child component within the scope of the enclosing component type.
name Optional overriding of the component profile name. If not supplied the component profile name will default to the name of the underlying component type.
activation Set the auto-activation policy (optional). The default value is SYSTEM. Possible values include STARTUP (triggers activation on startup), DEMAND (activation trigger on demand) and SYSTEM (activation decesions are delagated to the container).
collection Overrides the component garbage collection policy (optional). Allowable values include WEAK, SOFT and HARD. A component declaring a WEAK collection policy will be garbage collected at the discretion of the JVM. A component declaring a SOFT collection policy will be garbage collected in the event of memory contention. A component declaring the HARD collection policy will remain in memory for the lifetime of the JVM unless explicitly removed via a management system or controlling application.
Special Test Attributes
test The test attribute internally switches the implementation to generate a local file reference for the project jar file when constructing the component classloader defintion. This enables the deployment of the component type in a unit test prior to the publication of the project jar file. Used only in conjunction with top-level component declarations. Typically used in conjunction with the dest attribute.
dest Normally the component will construct an artifact under the project target/deliverables/parts directory. When generating deployment descriptors for local testing the dest enables the nomination of a local destination filename. Setting dest to any value will disable production of a deliverable artifact. Normally used in conjuction with the test attribute.
Nested Elements
categories The categories element may contain 0..n logging <category> directives. A category directive allows manipulation of logging channel priorities and targets.
configuration Declaration of a default configuration instance.
parameters Declaration of a default parameters instance.
context Declaration of the component initial context state.
parts Declaration of the nested componets.
Examples
Simple Example

Example of the creation of a test component directive using the test attribute in conjunction with the dest attribute. The example includes the declaration of lazy activation and HARD collection policy. The nested context definition asserts an initial value for the color context entry to the Color RED.

<component xmlns="dpml:metro" dest="target/test/composite.part" test="true" activation="false"
   type="net.dpml.test.composite.CompositeComponent" name="composite" collection="hard">
  <context>
    <entry key="color" method="RED"/>
  </context>
</component>