DPML
DPML Metro: Packaged Profiles
HomeUtilitiesStationMetro
Packaged Profiles

A packaged profile is an optional XML document colocated with the component class using the filename convention [classname].xprofile. The document contains a <profile> root element. The profile element may contain nested <context> and/or <parts> elements corresponding to the default deployment data.

Namespace
dpml:metro
Profile Attributes
activation Set the default activation policy (optional). If not specified, the default value will be resolved using the value of an activation annotation (if present), otherwise the default demand policy will apply. Allowable values include demand or startup.
lifestyle Set the default lifestyle policy (optional). Allowable values include singleton, thread, and transient. A component declaring the singleton lifestyle may be shared across all consumers within the JVM (i.e. the potential for concurrent access will exist). A component declaring the thread lifestyle policy may have a set of instances corresponding to the number of threads requesting access. A component declaring the transient lifestyle will instantiated for each access request. If not specified the default value will be resolved from a Component annotation in the class (or the default thread if no annotation is present).
collection Sets the garbage collection policy (optional). Allowable values include weak, soft and hard. A component type 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. If not specified the default value will be resolved from a Component annotation in the class (or the default hard policy if no annotation is present).
Nested Elements
context Declaration of the component default context state.
parts Declaration of default nested components.
Examples

The following sample profile contains a context definition that establishes default values for the firstName and lastName entries.

<profile xmlns="dpml:metro" lifestyle="singleton">
  <context>
    <entry key="firstName" value="Fred"/>
    <entry key="lastName" value="Flintstone"/>
  </context>
</profile>