Avalon Component Service

The Avalon Component service loads external modules which implement the Avalon lifecycle interfaces.

The only supported component at this point in time is Torque, though the Fulcrum components are likely to be migrated to become Avalon components in the future.

Dependencies

Don't forget to update the dependencies of your project to match those defined for Turbine and the components you are loading:

Configuration

# -------------------------------------------------------------------
#
#  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]

services.AvalonComponentService.classname = org.apache.turbine.services.avaloncomponent.TurbineAvalonComponentService
.
.
.
# -------------------------------------------------------------------
#
#  A V A L O N   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.AvalonComponentService.componentConfiguration = /WEB-INF/conf/componentConfiguration.xml
services.AvalonComponentService.componentRoles = /WEB-INF/conf/roleConfiguration.xml
services.AvalonComponentService.lookup = org.apache.torque.avalon.Torque

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

<componentConfig>
    <torque>
       <configfile>/WEB-INF/conf/torque.properties</configfile>
    </torque>
</componentConfig>

and roleConfiguration.xml:

<role-list>
    <role name="org.apache.torque.avalon.Torque"
          shorthand="torque"
          default-class="org.apache.torque.avalon.TorqueComponent" />
</role-list>

No changes to torque.properties are required.

If all goes well you should see the following in your log file when Turbine starts up:

...INFO...services.BaseServiceBroker - Added Mapping for Service: AvalonComponentService
...INFO...services.BaseServiceBroker - Start Initializing service (early): AvalonComponentService
...INFO...services.avaloncomponent.TurbineAvalonComponentService - Lookup for Component org.apache.torque.avalon.Torque successful
...INFO...services.BaseServiceBroker - Finish Initializing service (early): AvalonComponentService

Usage

If you plan to use the decoupled Torque in your application, you should leave the Avalon Component Service configured at all times. It is started at early startup time. Once it has initialized all the components, there are no application specific methods or services available.