Klasse 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()
- Autor:
- Siegfried Goeschl
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addToContext
(String name, Object value) Add a new entry to the context by creating a new one.void
addToContext
(Hashtable<?, ?> hashtable) Add a hashtable to the contextorg.apache.avalon.framework.configuration.Configuration
Create a final configuration.org.apache.avalon.framework.context.Context
Create 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.Logger
org.apache.avalon.framework.service.ServiceManager
Get 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.boolean
void
loadContainerConfiguration
(String location) Loads a containerConfiguration file and set is as the Avalon configuration to be used for Configurable.configure().void
loadContainerConfiguration
(String location, String isEncrypted) Loads a containerConfiguration file and set is as the Avalon configuration to be used for Configurable.configure().void
setApplicationRootDir
(String applicationRootDir) void
setComponentClassLoader
(ClassLoader componentClassLoader) void
setComponentConfigurationEncrypted
(String isComponentConfigurationEncrypted) void
setComponentConfigurationLocation
(String componentConfigurationLocation) void
setComponentRolesEncrypted
(String isComponentRolesEncrypted) void
setComponentRolesLocation
(String componentRolesLocation) void
setContainerConfiguration
(org.apache.avalon.framework.configuration.Configuration containerConfiguration) void
setContainerFlavour
(String containerFlavour) void
setContext
(org.apache.avalon.framework.context.Context context) void
setLogger
(org.apache.avalon.framework.logger.Logger logger) void
setParametersEncrypted
(String isParametersEncrypted) void
setParametersLocation
(String parametersLocation) void
setParentServiceManager
(org.apache.avalon.framework.service.ServiceManager parentServiceManager) Set the parent service manager to find service managed by the parent container.void
setServiceManagerList
(String[] serviceManagerList) Set a list of service manager managing their own set of services.void
setTempRootDir
(String tempRootDir)
-
Konstruktordetails
-
ServiceContainerConfiguration
public ServiceContainerConfiguration()Constructor -
ServiceContainerConfiguration
public ServiceContainerConfiguration(int logLevel) Constructor.- Parameter:
logLevel
- the log level for the console logger.
-
-
Methodendetails
-
addToContext
Add a new entry to the context by creating a new one.- Parameter:
name
- the name of the new entryvalue
- the value of the new entry
-
addToContext
Add a hashtable to the context- Parameter:
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
- Gibt zurück:
- the final Context
- Löst aus:
Exception
- if filename not definedIOException
- if file not found
-
createFinalConfiguration
public org.apache.avalon.framework.configuration.Configuration createFinalConfiguration()Create a final configuration.- Gibt zurück:
- the configuration
-
setComponentConfigurationLocation
- Parameter:
componentConfigurationLocation
- The componentConfigurationLocation to set.
-
setComponentRolesLocation
- Parameter:
componentRolesLocation
- The componentRolesLocation to set.
-
setContext
public void setContext(org.apache.avalon.framework.context.Context context) - Parameter:
context
- The context to set.
-
setComponentConfigurationEncrypted
- Parameter:
isComponentConfigurationEncrypted
- The isComponentConfigurationEncrypted to set.
-
setComponentRolesEncrypted
- Parameter:
isComponentRolesEncrypted
- The isComponentRolesEncrypted to set.
-
setParametersEncrypted
- Parameter:
isParametersEncrypted
- The isParametersEncrypted to set.
-
getLogger
public org.apache.avalon.framework.logger.Logger getLogger()- Gibt zurück:
- Returns the logger.
-
setLogger
public void setLogger(org.apache.avalon.framework.logger.Logger logger) - Parameter:
logger
- The logger to set.
-
setParametersLocation
- Parameter:
parametersLocation
- The parametersLocation to set.
-
setApplicationRootDir
- Parameter:
applicationRootDir
- The applicationRootDir to set.
-
setTempRootDir
- Parameter:
tempRootDir
- The tempRootDir to set.
-
setComponentClassLoader
- Parameter:
componentClassLoader
- The classLoader to set.
-
setContainerFlavour
- Parameter:
containerFlavour
- The containerFlavour to set.
-
setContainerConfiguration
public void setContainerConfiguration(org.apache.avalon.framework.configuration.Configuration containerConfiguration) - Parameter:
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.- Gibt zurück:
- 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.- Parameter:
parentServiceManager
- the parent container
-
getServiceManagerList
Get a list of service manager managing their own set of services.- Gibt zurück:
- a list of service implementing the ServiceManager interface
-
setServiceManagerList
Set a list of service manager managing their own set of services.- Parameter:
serviceManagerList
- a list of service implementing the ServiceManager interface
-
hasServiceManagerList
public boolean hasServiceManagerList()- Gibt zurück:
- 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.- Parameter:
location
- the location of the containerConfiguration- Löst aus:
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.- Parameter:
location
- the location of the containerConfigurationisEncrypted
- is the file encrypted- Löst aus:
IOException
- loading the configuration failed
-