Class ServiceContainerConfiguration
java.lang.Object
org.apache.fulcrum.yaafi.framework.factory.ServiceContainerConfiguration
Helper class to capture configuration related stuff. The are two ways for
setting up the configuration:
- set all parameters manually
- use a containerConfiguration file and provide the remaining settings
- createFinalContext()
- createFinalConfiguration()
- Author:
- Siegfried Goeschl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToContext(String name, Object value) Add a new entry to the context by creating a new one.voidaddToContext(Hashtable<?, ?> hashtable) Add a hashtable to the contextorg.apache.avalon.framework.configuration.ConfigurationCreate a final configuration.org.apache.avalon.framework.context.ContextCreate the final Avalon context passed to YAAFI containing user-supplied context urn:avalon:home urn:avalon:temp urn:avalon:name urn:avalon:partition urn:avalon:classloaderorg.apache.avalon.framework.logger.Loggerorg.apache.avalon.framework.service.ServiceManagerGet the parent service manager to find service managed by the parent container.String[]Get a list of service manager managing their own set of services.booleanvoidloadContainerConfiguration(String location) Loads a containerConfiguration file and set is as the Avalon configuration to be used for Configurable.configure().voidloadContainerConfiguration(String location, String isEncrypted) Loads a containerConfiguration file and set is as the Avalon configuration to be used for Configurable.configure().voidsetApplicationRootDir(String applicationRootDir) voidsetComponentClassLoader(ClassLoader componentClassLoader) voidsetComponentConfigurationEncrypted(String isComponentConfigurationEncrypted) voidsetComponentConfigurationLocation(String componentConfigurationLocation) voidsetComponentRolesEncrypted(String isComponentRolesEncrypted) voidsetComponentRolesLocation(String componentRolesLocation) voidsetContainerConfiguration(org.apache.avalon.framework.configuration.Configuration containerConfiguration) voidsetContainerFlavour(String containerFlavour) voidsetContext(org.apache.avalon.framework.context.Context context) voidsetLogger(org.apache.avalon.framework.logger.Logger logger) voidsetParametersEncrypted(String isParametersEncrypted) voidsetParametersLocation(String parametersLocation) voidsetParentServiceManager(org.apache.avalon.framework.service.ServiceManager parentServiceManager) Set the parent service manager to find service managed by the parent container.voidsetServiceManagerList(String[] serviceManagerList) Set a list of service manager managing their own set of services.voidsetTempRootDir(String tempRootDir)
-
Constructor Details
-
ServiceContainerConfiguration
public ServiceContainerConfiguration()Constructor -
ServiceContainerConfiguration
public ServiceContainerConfiguration(int logLevel) Constructor.- Parameters:
logLevel- the log level for the console logger.
-
-
Method Details
-
addToContext
Add a new entry to the context by creating a new one.- Parameters:
name- the name of the new entryvalue- the value of the new entry
-
addToContext
Add a hashtable to the context- Parameters:
hashtable- the Hashtable to be added
-
createFinalContext
public org.apache.avalon.framework.context.Context createFinalContext() throws IOException, ExceptionCreate the final Avalon context passed to YAAFI containing- user-supplied context
- urn:avalon:home
- urn:avalon:temp
- urn:avalon:name
- urn:avalon:partition
- urn:avalon:classloader
- Returns:
- the final Context
- Throws:
Exception- if filename not definedIOException- if file not found
-
createFinalConfiguration
public org.apache.avalon.framework.configuration.Configuration createFinalConfiguration()Create a final configuration.- Returns:
- the configuration
-
setComponentConfigurationLocation
- Parameters:
componentConfigurationLocation- The componentConfigurationLocation to set.
-
setComponentRolesLocation
- Parameters:
componentRolesLocation- The componentRolesLocation to set.
-
setContext
public void setContext(org.apache.avalon.framework.context.Context context) - Parameters:
context- The context to set.
-
setComponentConfigurationEncrypted
- Parameters:
isComponentConfigurationEncrypted- The isComponentConfigurationEncrypted to set.
-
setComponentRolesEncrypted
- Parameters:
isComponentRolesEncrypted- The isComponentRolesEncrypted to set.
-
setParametersEncrypted
- Parameters:
isParametersEncrypted- The isParametersEncrypted to set.
-
getLogger
public org.apache.avalon.framework.logger.Logger getLogger()- Returns:
- Returns the logger.
-
setLogger
public void setLogger(org.apache.avalon.framework.logger.Logger logger) - Parameters:
logger- The logger to set.
-
setParametersLocation
- Parameters:
parametersLocation- The parametersLocation to set.
-
setApplicationRootDir
- Parameters:
applicationRootDir- The applicationRootDir to set.
-
setTempRootDir
- Parameters:
tempRootDir- The tempRootDir to set.
-
setComponentClassLoader
- Parameters:
componentClassLoader- The classLoader to set.
-
setContainerFlavour
- Parameters:
containerFlavour- The containerFlavour to set.
-
setContainerConfiguration
public void setContainerConfiguration(org.apache.avalon.framework.configuration.Configuration containerConfiguration) - Parameters:
containerConfiguration- The containerConfiguration to set.
-
getParentServiceManager
public org.apache.avalon.framework.service.ServiceManager getParentServiceManager()Get the parent service manager to find service managed by the parent container.- Returns:
- the parent container
-
setParentServiceManager
public void setParentServiceManager(org.apache.avalon.framework.service.ServiceManager parentServiceManager) Set the parent service manager to find service managed by the parent container.- Parameters:
parentServiceManager- the parent container
-
getServiceManagerList
Get a list of service manager managing their own set of services.- Returns:
- a list of service implementing the ServiceManager interface
-
setServiceManagerList
Set a list of service manager managing their own set of services.- Parameters:
serviceManagerList- a list of service implementing the ServiceManager interface
-
hasServiceManagerList
public boolean hasServiceManagerList()- Returns:
- true if there is a service manager defined
-
loadContainerConfiguration
Loads a containerConfiguration file and set is as the Avalon configuration to be used for Configurable.configure(). Take care that the implementation uses an InputStreamLocator to find the containerConfiguration which uses the previously set application root directory.- Parameters:
location- the location of the containerConfiguration- Throws:
IOException- loading the configuration failed
-
loadContainerConfiguration
Loads a containerConfiguration file and set is as the Avalon configuration to be used for Configurable.configure(). Take care that the implementation uses an InputStreamLocator to find the containerConfiguration which uses the previously set application root directory.- Parameters:
location- the location of the containerConfigurationisEncrypted- is the file encrypted- Throws:
IOException- loading the configuration failed
-