General

Torque has provided Avalon Component support for some time now. This little HowTo should provide the necessary information to use Torque with some Avalon containers, namely ECM, Merlin and Fulcrum-YAAFI.

Configuration

The configuration is straightforward. Use the following snippet to make the Torque component available in your container:

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

Torque will need access to its configuration file, so the component configuration looks like this:

<componentConfig>
    <Torque>
      <configFile>/WEB-INF/conf/Torque.properties</configFile>
    </Torque>
</componentConfig>

The path of the configuration file is relative to the application root of the container.

Use

All access to the Torque component should go through the org.apache.torque.avalon.Torque interface. It provides all methods available in TorqueInstance. The role name to lookup the component in your container is also org.apache.torque.avalon.Torque.