The component tag declares a java source as a component type. The tag is a required when generating a component type descriptor.
Attribute | Required | Description |
---|---|---|
name | yes |
The name representing the component type. |
version | no |
The version used for this component implementation. If not supplied a default version of 1.0 is assumed. |
lifestyle | no |
The lifestyle that the component was designed for. The lifestyle may be one of four predefined values. A compliant container is not required to provide equivalent lifestyle support, however, a container is required to recognize and reject a component that it cannot support. If not declared, a container may assume the transient lifestyle. Recognized lifestyle attribute values include:
|
package org.apache.avalon.playground; /** * Example of the declaration of named component type. * * @avalon.component version="1.0" name="sample" lifestyle="singleton" */ public class DefaultComponent { ... }
Generated meta-info type descriptor:
<type> <info> <version>1.0.0</version> <name>sample</name> <lifestyle>singleton</lifestyle> </info> </type>