org.apache.turbine.services.avaloncomponent
Class TurbineAvalonComponentService
java.lang.Object
org.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.turbine.services.avaloncomponent.TurbineAvalonComponentService
- All Implemented Interfaces:
- AvalonComponentService, org.apache.avalon.framework.activity.Disposable, Initable, org.apache.avalon.framework.activity.Initializable, Service
- public class TurbineAvalonComponentService
- extends TurbineBaseService
- implements AvalonComponentService, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.activity.Disposable
An implementation of AvalonComponentService which loads all the
components given in the TurbineResources.properties File.
For component which require the location of the application or
context root, there are two ways to get it.
-
Implement the Contextualizable interface. The full path to the
correct OS directory can be found under the ComponentAppRoot key.
-
The system property "applicationRoot" is also set to the full path
of the correct OS directory.
If you want to initialize Torque by using the AvalonComponentService, you
must activate Torque at initialization time by specifying
services.AvalonComponentService.lookup = org.apache.torque.avalon.Torque
in your TurbineResources.properties.
- Version:
- $Id: TurbineAvalonComponentService.java 280565 2005-09-13 14:39:33Z henning $
- Author:
- Quinton McCombs, Henning P. Schmiedehausen
Method Summary |
void |
dispose()
Disposes of the container and releases resources |
void |
init()
Load all configured components and initialize them. |
void |
initialize()
Initializes the container |
org.apache.avalon.framework.component.Component |
lookup(java.lang.String roleName)
Returns an instance of the named component |
void |
release(org.apache.avalon.framework.component.Component component)
Releases the component |
void |
shutdown()
Shuts the Component Service down, calls dispose on the components that
implement this interface |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TurbineAvalonComponentService
public TurbineAvalonComponentService()
init
public void init()
throws InitializationException
- Load all configured components and initialize them. This is
a zero parameter variant which queries the Turbine Servlet
for its config.
- Specified by:
init
in interface Initable
- Overrides:
init
in class TurbineBaseService
- Throws:
InitializationException
- Something went wrong in the init
stage
shutdown
public void shutdown()
- Shuts the Component Service down, calls dispose on the components that
implement this interface
- Specified by:
shutdown
in interface Initable
- Overrides:
shutdown
in class TurbineBaseService
initialize
public void initialize()
throws java.lang.Exception
- Initializes the container
- Specified by:
initialize
in interface org.apache.avalon.framework.activity.Initializable
- Throws:
java.lang.Exception
- generic exception
dispose
public void dispose()
- Disposes of the container and releases resources
- Specified by:
dispose
in interface org.apache.avalon.framework.activity.Disposable
lookup
public org.apache.avalon.framework.component.Component lookup(java.lang.String roleName)
throws org.apache.avalon.framework.component.ComponentException
- Returns an instance of the named component
- Specified by:
lookup
in interface AvalonComponentService
- Parameters:
roleName
- Name of the role the component fills.
- Returns:
- an instance of the named component
- Throws:
org.apache.avalon.framework.component.ComponentException
- generic exception
release
public void release(org.apache.avalon.framework.component.Component component)
- Releases the component
- Specified by:
release
in interface AvalonComponentService
- Parameters:
component
- the component to release
Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.