Component Service

The Component service loads external modules which implement the org.apache.stratum.lifecycle Interfaces for use with Turbine 2.

Main usage for this are the Torque and Fulcrum components of the Turbine project.

As Turbine-2 now uses the decoupled Torque, you must initialize Torque at startup. Fulcrum is currently not integrated in Turbine-2.2 but you can use some services from it.

As of version 2.3 Turbine now provides an Avalon Component Service that can be used to configure Torque. In future releases additional components will be migrated to Avalon components, most likely as part of Fulcrum.

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.ComponentService.classname=org.apache.turbine.services.component.TurbineComponentService
.
.
.
# -------------------------------------------------------------------
# 
#  C O M P O N E N T   S E R V I C E
#
# -------------------------------------------------------------------
# Components implementing the lifecycle interfaces can be loaded,
# configured and initialized by Turbine
# -------------------------------------------------------------------

#
# Here you define the names of the various components to load. These
# names are used as identifiers later so you can choose them freely. It
# is, however, sensible to use the same names as the component projects
# that you want to load.
#
services.ComponentService.name = torque

#
# This is the class of the component to be loaded. 
#
# It must implement the org.apache.stratum.lifecycle.Initializable and
# org.apache.stratum.lifecycle.Configurable interface to be loaded.
#
# It may implement the org.apache.stratum.lifecycle.Disposable interface.
# If it does, the Component is disposed at shutdown (Servlet destroy()) time.
#
services.ComponentService.torque.classname = org.apache.torque.Torque

#
# This is the path to the Config file of the Component. It is relative
# to the Root of the Application (either the Webroot given by the Servlet
# Container or the Root given to TurbineConfig at startup time)
#
services.ComponentService.torque.config = /conf/Torque.properties

#
# Properties can be given directly to Components. This sets the "foo"
# property for torque to "bar".
#
services.ComponentService.torque.property.foo = bar

# This is an example of how to load Fulcrum as a component
#
#
services.ComponentService.name = fulcrum			  
services.ComponentService.fulcrum.classname = org.apache.fulcrum.Fulcrum
services.ComponentService.fulcrum.config = /conf/Fulcrum.properties

Usage

If you plan to use the decoupled Torque in your application, you should leave the 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.