Avalon Component Service

The Yaafi Component service loads external modules which implement the Avalon lifecycle interfaces. This is a bridge between the Turbine 2.3 we have today and the Fulcrum components that until now have only been available to Turbine 2.4 (yet to be released).

Most of the Fulcrum components should work using this service, however it is only being added in Turbine 2.3.3, so you should ensure that you perform your own testing to verify the desired behaviour of your application, though note that the author is successfully running Torque, Fulcrum Quartz as well as making use for Yaafi's ServiceManager and SystemProperty services - all under Turbine 2.3.


If you are using Yaafi Component Service you will need to add Yaafi as a dependency (the following is from a Maven 2 POM):


If you are no longer using the Avalon Component Service you can stop your build from including the Excalibur dependencies thus (again from a Maven 2 POM):

    There are a few Turbine dependencies, included for the AvalonComponentService,
    that are not needed when using YaafiComponentService as a replacement.

The above is based on the turbine-2.3.2 pom that exists in the default maven 2 repository. Whether or not you need the above will depend on how these dependencies are declared in the final version of the Turbine 2.3.3 POM (just including Yaafi should be enough if they are all declared as optional).


# -------------------------------------------------------------------
#  S E R V I C E S
# -------------------------------------------------------------------
# Classes for Turbine Services should be defined here.
# Format: services.[name].classname=[implementing class]
# To specify properties of a service use the following syntax:
# service.[name].[property]=[value]


# -------------------------------------------------------------------
#  Y A A F I   C O M P O N E N T   S E R V I C E
# -------------------------------------------------------------------
# Components implementing the avalon lifecycle interfaces can be
# loaded, configured and initialized by Turbine
# -------------------------------------------------------------------

services.YaafiComponentService.containerConfiguration = /WEB-INF/conf/containerConfiguration.xml

In /WEB-INF/conf you should provide containerConfiguration.xml:



    <role name="org.apache.fulcrum.yaafi.service.servicemanager.ServiceManagerService"
    <role name="org.apache.fulcrum.yaafi.service.systemproperty.SystemPropertyService"
    <role name="org.apache.torque.avalon.Torque"
    <!-- Details of other components and services you want to use. -->

and componentConfiguration.xml:

        <property name="my.property">my property value</property>


    <!-- Configuration for other components and services. -->

No changes to torque.properties are required.

If all goes well you should see the following in your log file when Turbine starts up (actual output will depend on your logging configuration):

...INFO...services.BaseServiceBroker - Added Mapping for Service: ACSYaafiComponentService
...INFO...services.BaseServiceBroker - Start Initializing service (early): ACSYaafiComponentService
...INFO...avaloncomponent.ACSYaafiComponentService - Initializing ACSYaafiComponentService ...
...DEBUG...avalon - Incarnating the service org.apache.fulcrum.yaafi.service.servicemanager.ServiceManagerService
...DEBUG...avalon - Incarnating the service SystemPropertyService
...DEBUG...avalon - Incarnating the service torque
...INFO...avalon - YAAFI Avalon Service Container is up and running
...INFO...services.BaseServiceBroker - Finish Initializing service (early): ACSYaafiComponentService


If you plan to use the decoupled Torque in your application, you should leave the Yaafi Component Service configured at all times. It is started at early startup time. See the Yaafi documentation for more information and for details of the various services that it provides and the Fulcrum site for details of the other components that are available.