Role Configuration
The Role Configuration File is used to map the services to implementation classes.
Specification
Item | Datatype | Cardinality | Description |
---|---|---|---|
role | Tree | [0..n] | Metadata about a service component to be instantiated |
role@name | String | [0|1] | The name of the service being used for the lookup. If no value is defined then role@default-class will be used. |
role@shorthand | String | [0|1] | The shorthand for referencing the section in the Component Configuration File. If no value is defined then role@name will be used. |
role@default-class | String | 1 | The implementation class of the service. |
role@early-init | Boolean | [0|1] | Shall the service implementation class be instantiated during startup of the container or on demand? If no value is defined then true will be used. |
role@componentType | String | [0|1] | The type of component whereas we currently support "avalon" only |
role@componentFlavour | String | [0|1] | The flavour for the given component type either "phoenix", "fortress", "merlin", "yaafi". If no value is defined then yaffi will be used. |
role@has-proxy | boolean | [0|1] | Defines if an dynamic proxy will be used for the service instance. If no value is defined thant true will be used. |
role@logger | String | [0|1] | The name of the logging category for the service. The logging catetegory being constructed is concatenated with the logging category of the service container, e.g "YAAFI.MyLogCategory". |
role@description | String | [0|1] | A description what the service is actually doing. |
role/interceptors | Tree | [0|1] | Contains a list of service specific interceptors |
role/interceptors/interceptor | String | [0..n] | Contains the service name of an interceptor |
Example 1
<role-list> <role name="org.apache.fulcrum.yaafi.service.systemproperty.SystemPropertyService" shorthand="SystemPropertyService" default-class="org.apache.fulcrum.yaafi.service.systemproperty.SystemPropertyServiceImpl" /> </role-list>
Example 2
<role-list> <role name="org.apache.fulcrum.yaafi.service.systemproperty.SystemPropertyService" shorthand="SystemPropertyService" default-class="org.apache.fulcrum.yaafi.service.systemproperty.SystemPropertyServiceImpl" early-init="true" component-type="merlin" description="Copies name/value pairs into the SystemProperties" /> </role-list>
Example 3
<role-list> <role name="org.apache.fulcrum.yaafi.TestComponent" shorthand="test" default-class="org.apache.fulcrum.yaafi.TestComponentImpl" early-init="true" component-type="merlin" description="A simple test component"> <interceptors> <interceptor>org.apache.fulcrum.yaafi.interceptor.performance.PerformanceInterceptorService</interceptor> <interceptor>org.apache.fulcrum.yaafi.interceptor.logging.LoggingInterceptorService</interceptor> </interceptors> </role> </role-list>