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:
    org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.service.ServiceManager, AvalonComponentService, Initable, Service, TurbineServiceProvider

  Deprecated.

      @Deprecated
      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.

  1. Implement the Contextualizable interface. The full path to the correct OS directory can be found under the ComponentAppRoot key.
  2. 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.Torque in your TurbineResources.properties.
  Version:
    $Id: TurbineAvalonComponentService.java 1706239 2015-10-01 13:18:35Z tv $
  Author:
    Quinton McCombs, Henning P. Schmiedehausen

- - ### Field Summary

    - ### Fields inherited from class org.apache.turbine.services.BaseService

      `configuration, name, serviceBroker`

    - ### Fields inherited from class org.apache.turbine.services.BaseInitable

      `initableBroker, isInitialized`

    - ### Fields inherited from interface org.apache.turbine.services.avaloncomponent.AvalonComponentService

      `AVALON_LOG_CATEGORY, COMPONENT_APP_ROOT, COMPONENT_CONFIG_KEY, COMPONENT_CONFIG_VALUE, COMPONENT_LOOKUP_KEY, COMPONENT_ROLE_KEY, COMPONENT_ROLE_VALUE, SERVICE_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TurbineAvalonComponentService()` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dispose()` Deprecated. Disposes of the container and releases resources
    `boolean` | `exists(String roleName)` Deprecated. Is the service known to the service container?
    `Object` | `get(String roleName)` Deprecated. Returns an instance of the requested service.
    `boolean` | `hasService(String roleName)` Deprecated.
    `void` | `init()` Deprecated. Load all configured components and initialize them.
    `void` | `initialize()` Deprecated. Initializes the container
    `Object` | `lookup(String roleName)` Deprecated. Returns an instance of the named component
    `void` | `release(Object component)` Deprecated. Releases the component
    `void` | `shutdown()` Deprecated. Shuts the Component Service down, calls dispose on the components that implement this interface

    - ### Methods inherited from class org.apache.turbine.services.TurbineBaseService

      `init, init`

    - ### Methods inherited from class org.apache.turbine.services.BaseService

      `getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker`

    - ### Methods inherited from class org.apache.turbine.services.BaseInitable

      `getInit, getInitableBroker, setInit, setInitableBroker`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.turbine.services.Service

      `getConfiguration, getName, getProperties, setName, setServiceBroker`

    - ### Methods inherited from interface org.apache.turbine.services.Initable

      `getInit, init, setInitableBroker`

- - ### Constructor Detail

    - #### TurbineAvalonComponentService

          public TurbineAvalonComponentService()

      Deprecated.

  - ### Method Detail

    - #### init

          public void init()
                    throws InitializationException

      Deprecated.
      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()

      Deprecated.
      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 Exception

      Deprecated.
      Initializes the container
      Specified by:
        `initialize` in interface `org.apache.avalon.framework.activity.Initializable`
      Throws:
        `Exception` - generic exception

    - #### dispose

          public void dispose()

      Deprecated.
      Disposes of the container and releases resources
      Specified by:
        `dispose` in interface `org.apache.avalon.framework.activity.Disposable`

    - #### lookup

          public Object lookup(String roleName)
                        throws org.apache.avalon.framework.service.ServiceException

      Deprecated.
      Returns an instance of the named component
      Specified by:
        `lookup` in interface `org.apache.avalon.framework.service.ServiceManager`
      Parameters:
        `roleName` - Name of the role the component fills.
      Returns:
        an instance of the named component
      Throws:
        `org.apache.avalon.framework.service.ServiceException`

    - #### release

          public void release(Object component)

      Deprecated.
      Releases the component
      Specified by:
        `release` in interface `org.apache.avalon.framework.service.ServiceManager`
      Specified by:
        `release` in interface `TurbineServiceProvider`
      Parameters:
        `component` - the component to release

    - #### hasService

          public boolean hasService(String roleName)

      Deprecated.
      Specified by:
        `hasService` in interface `org.apache.avalon.framework.service.ServiceManager`
      See Also:
        `ServiceManager.hasService(java.lang.String)`

    - #### exists

          public boolean exists(String roleName)

      Deprecated.
      Description copied from interface: `TurbineServiceProvider`
      Is the service known to the service container?
      Specified by:
        `exists` in interface `TurbineServiceProvider`
      Parameters:
        `roleName` - the name of the requested service
      Returns:
        true if the service is known to the provider
      See Also:
        `TurbineServiceProvider.exists(java.lang.String)`

    - #### get

          public Object get(String roleName)
                     throws InstantiationException

      Deprecated.
      Description copied from interface: `TurbineServiceProvider`
      Returns an instance of the requested service. If the given service is not available/found we throw a RuntimeException since this is less intrusive.
      Specified by:
        `get` in interface `TurbineServiceProvider`
      Parameters:
        `roleName` - the name of the requested service
      Returns:
        an instance of the service
      Throws:
        `InstantiationException` - the service could not be instantiated
      See Also:
        `TurbineServiceProvider.get(java.lang.String)`

Copyright © 2000-2015 The Apache Software Foundation. All Rights Reserved.