Class TurbineYaafiComponentService
- java.lang.Object
- 
- org.apache.turbine.services.BaseInitable
- 
- org.apache.turbine.services.BaseService
- 
- org.apache.turbine.services.TurbineBaseService
- 
- org.apache.turbine.services.avaloncomponent.TurbineYaafiComponentService
 
 
 
 
- 
- 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
 
 public class TurbineYaafiComponentService extends TurbineBaseService implements AvalonComponentService, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.activity.Disposable An implementation of Turbine service initializing the YAAFI container- Author:
- Siegfried Goeschl
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCOMPONENT_PARAMETERS_KEYproperty to lookup the properties filestatic StringCOMPONENT_PARAMETERS_VALUEthe default value for the parameter filestatic StringCONTAINER_CONFIGURATION_KEYproperty to lookup the container configuration filestatic StringCONTAINER_CONFIGURATION_VALUEthe default value for the container configuration file- 
Fields inherited from class org.apache.turbine.services.BaseServiceconfiguration, name, serviceBroker
 - 
Fields inherited from class org.apache.turbine.services.BaseInitableinitableBroker, isInitialized
 - 
Fields inherited from interface org.apache.turbine.services.avaloncomponent.AvalonComponentServiceAVALON_LOG_CATEGORY, COMPONENT_APP_ROOT, COMPONENT_CONFIG_KEY, COMPONENT_CONFIG_VALUE, COMPONENT_LOOKUP_KEY, COMPONENT_ROLE_KEY, COMPONENT_ROLE_VALUE, SERVICE_NAME
 - 
Fields inherited from interface org.apache.turbine.services.ServiceSERVICE_NAME
 
- 
 - 
Constructor SummaryConstructors Constructor Description TurbineYaafiComponentService()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.avalon.framework.logger.LoggercreateAvalonLogger()Create the Avalon logger to be passed to YAAFI.protected org.apache.fulcrum.yaafi.framework.factory.ServiceContainerConfigurationcreateServiceContainerConfiguration(org.apache.commons.configuration2.Configuration conf, File applicationRoot)Create a ServiceContainerConfiguration based on the Turbine configurationvoiddispose()Disposes of the container and releases resourcesbooleanexists(String roleName)Is the service known to the service container?Objectget(String roleName)Returns an instance of the requested service.booleanhasService(String roleName)voidinit()Load all configured components and initialize them.voidinitialize()Initializes the containerObjectlookup(String roleName)Returns an instance of the named componentvoidrelease(Object component)Releases the component.voidshutdown()Shuts the Component Service down, calls dispose on the components that implement this interface- 
Methods inherited from class org.apache.turbine.services.TurbineBaseServiceinit, init
 - 
Methods inherited from class org.apache.turbine.services.BaseServicegetConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 - 
Methods inherited from class org.apache.turbine.services.BaseInitablegetInit, getInitableBroker, setInit, setInitableBroker
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.turbine.services.InitablegetInit, init, setInitableBroker
 - 
Methods inherited from interface org.apache.turbine.services.ServicegetConfiguration, getName, getProperties, setName, setServiceBroker
 
- 
 
- 
- 
- 
Field Detail- 
CONTAINER_CONFIGURATION_KEYpublic static final String CONTAINER_CONFIGURATION_KEY property to lookup the container configuration file- See Also:
- Constant Field Values
 
 - 
CONTAINER_CONFIGURATION_VALUEpublic static final String CONTAINER_CONFIGURATION_VALUE the default value for the container configuration file- See Also:
- Constant Field Values
 
 - 
COMPONENT_PARAMETERS_KEYpublic static final String COMPONENT_PARAMETERS_KEY property to lookup the properties file- See Also:
- Constant Field Values
 
 - 
COMPONENT_PARAMETERS_VALUEpublic static final String COMPONENT_PARAMETERS_VALUE the default value for the parameter file- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
TurbineYaafiComponentServicepublic TurbineYaafiComponentService() 
 
- 
 - 
Method Detail- 
initpublic 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:
- initin interface- Initable
- Overrides:
- initin class- TurbineBaseService
- Throws:
- InitializationException- Something went wrong in the init stage
 
 - 
shutdownpublic void shutdown() Shuts the Component Service down, calls dispose on the components that implement this interface- Specified by:
- shutdownin interface- Initable
- Overrides:
- shutdownin class- TurbineBaseService
 
 - 
initializepublic void initialize() throws Exception Initializes the container- Specified by:
- initializein interface- org.apache.avalon.framework.activity.Initializable
- Throws:
- Exception- generic exception
 
 - 
disposepublic void dispose() Disposes of the container and releases resources- Specified by:
- disposein interface- org.apache.avalon.framework.activity.Disposable
 
 - 
lookuppublic Object lookup(String roleName) throws org.apache.avalon.framework.service.ServiceException Returns an instance of the named component- Specified by:
- lookupin 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
 
 - 
releasepublic void release(Object component) Releases the component.- Specified by:
- releasein interface- org.apache.avalon.framework.service.ServiceManager
- Specified by:
- releasein interface- TurbineServiceProvider
- Parameters:
- component- the component to release
 
 - 
hasServicepublic boolean hasService(String roleName) - Specified by:
- hasServicein interface- org.apache.avalon.framework.service.ServiceManager
- See Also:
- ServiceManager.hasService(java.lang.String)
 
 - 
createServiceContainerConfigurationprotected org.apache.fulcrum.yaafi.framework.factory.ServiceContainerConfiguration createServiceContainerConfiguration(org.apache.commons.configuration2.Configuration conf, File applicationRoot) throws IOException Create a ServiceContainerConfiguration based on the Turbine configuration- Parameters:
- conf- the Turbine configuration
- applicationRoot- the application root directory
- Returns:
- the YAAFI configuration
- Throws:
- IOException- creating the YAAFI configuration failed
 
 - 
createAvalonLoggerprotected org.apache.avalon.framework.logger.Logger createAvalonLogger() Create the Avalon logger to be passed to YAAFI.- Returns:
- an Avalon Logger
 
 - 
existspublic boolean exists(String roleName) Description copied from interface:TurbineServiceProviderIs the service known to the service container?- Specified by:
- existsin 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)
 
 - 
getpublic Object get(String roleName) throws InstantiationException Description copied from interface:TurbineServiceProviderReturns 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:
- getin 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)
 
 
- 
 
-