org.apache.fulcrum.yaafi.framework.factory
Class ServiceContainerConfiguration

java.lang.Object
  extended by org.apache.fulcrum.yaafi.framework.factory.ServiceContainerConfiguration

public class ServiceContainerConfiguration
extends Object

Helper class to capture configuration related stuff. The are two ways for setting up the configuration:

The Avalon context and configuration are created by

Author:
Siegfried Goeschl

Constructor Summary
ServiceContainerConfiguration()
          Constructor
 
Method Summary
 void addToContext(Hashtable hashtable)
          Add a hashtable to the context
 void addToContext(String name, Object value)
          Add a new entry to the context by creating a new one.
 org.apache.avalon.framework.configuration.Configuration createFinalConfiguration()
          Create a final configuration.
 org.apache.avalon.framework.context.Context createFinalContext()
          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:classloader
 org.apache.avalon.framework.logger.Logger getLogger()
           
 org.apache.avalon.framework.service.ServiceManager getParentServiceManager()
          Get the parent service manager to find service managed by the parent container.
 String[] getServiceManagerList()
          Get a list of service manager managing their own set of services.
 boolean hasServiceManagerList()
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceContainerConfiguration

public ServiceContainerConfiguration()
Constructor

Method Detail

addToContext

public void addToContext(String name,
                         Object value)
Add a new entry to the context by creating a new one.

Parameters:
name - the name of the new entry
value - the value of the new entry

addToContext

public void addToContext(Hashtable hashtable)
Add a hashtable to the context

Parameters:
hashtable - the Hashtable to be added

createFinalContext

public org.apache.avalon.framework.context.Context createFinalContext()
Create the final Avalon context passed to YAAFI containing

Returns:
the final Context

createFinalConfiguration

public org.apache.avalon.framework.configuration.Configuration createFinalConfiguration()
Create a final configuration.

Returns:
the configuration

setComponentConfigurationLocation

public void setComponentConfigurationLocation(String componentConfigurationLocation)
Parameters:
componentConfigurationLocation - The componentConfigurationLocation to set.

setComponentRolesLocation

public void setComponentRolesLocation(String componentRolesLocation)
Parameters:
componentRolesLocation - The componentRolesLocation to set.

setContext

public void setContext(org.apache.avalon.framework.context.Context context)
Parameters:
context - The context to set.

setComponentConfigurationEncrypted

public void setComponentConfigurationEncrypted(String isComponentConfigurationEncrypted)
Parameters:
isComponentConfigurationEncrypted - The isComponentConfigurationEncrypted to set.

setComponentRolesEncrypted

public void setComponentRolesEncrypted(String isComponentRolesEncrypted)
Parameters:
isComponentRolesEncrypted - The isComponentRolesEncrypted to set.

setParametersEncrypted

public void setParametersEncrypted(String isParametersEncrypted)
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

public void setParametersLocation(String parametersLocation)
Parameters:
parametersLocation - The parametersLocation to set.

setApplicationRootDir

public void setApplicationRootDir(String applicationRootDir)
Parameters:
applicationRootDir - The applicationRootDir to set.

setTempRootDir

public void setTempRootDir(String tempRootDir)
Parameters:
tempRootDir - The tempRootDir to set.

setComponentClassLoader

public void setComponentClassLoader(ClassLoader componentClassLoader)
Parameters:
componentClassLoader - The classLoader to set.

setContainerFlavour

public void setContainerFlavour(String containerFlavour)
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

public String[] getServiceManagerList()
Get a list of service manager managing their own set of services.

Returns:
a list of service implementing the ServiceManager interface

setServiceManagerList

public void setServiceManagerList(String[] serviceManagerList)
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:
is a list of service manager managing their own set of services defined

loadContainerConfiguration

public void loadContainerConfiguration(String location)
                                throws IOException
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

public void loadContainerConfiguration(String location,
                                       String isEncrypted)
                                throws IOException
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
isEncrypted - is the file encrypted
Throws:
IOException - loading the configuration failed


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.